I am trying to make a script to automatically create a file directory from information on forms I have created in excel.What the file structure will look like What the form looks like. I have a script that will create the file directory after i extract the information. I just need help with the script that will extract the information and copy it to column A on my File Directory sheet. A9 of the form will always be the name of the folder and sub folders will either be product data, shop drawings, samples, warranties, or material certificates. not all forms will have all of them though.
My thought would be to use a if function if the sheet has product data it would place A9/productdata to file directory. I need it to do this for each sheet in the workbook.
Sub FileDirectory()
Dim ws As Worksheet
Application.ScreenUpdating = False
For Each ws In ActiveWorkbook.Worksheets
If ws.Name <> "File Directory" Then
ws.Range("A9").Copy Sheets("File Directory").Cells(Rows.Count, "A").End(xlUp).Offset(1)
End If
Next
Application.ScreenUpdating = True
End Sub
This is as far as i got to copy A9 from each worksheet to file directory. i cant figure out how to create the if to create the sub folders. any help would be appreciated!
Aucun commentaire:
Enregistrer un commentaire