Sub B_Make_Folders()
Dim fname As String
Dim dirname As String
Dim team_members() As Variant
dirname = Workbooks("folder_macro.xls").Worksheets("Sheet1").Range("C2").Value
team_members() = Array(Workbooks("folder_macro.xls").Worksheets("Sheet1").Range("A2").Value, Workbooks("folder_macro.xls").Worksheets("Sheet1").Range("A3").Value, Workbooks("folder_macro.xls").Worksheets("Sheet1").Range("A4").Value, Workbooks("folder_macro.xls").Worksheets("Sheet1").Range("A5").Value, Workbooks("folder_macro.xls").Worksheets("Sheet1").Range("A6").Value, Workbooks("folder_macro.xls").Worksheets("Sheet1").Range("A7").Value, Workbooks("folder_macro.xls").Worksheets("Sheet1").Range("A8").Value, Workbooks("folder_macro.xls").Worksheets("Sheet1").Range("A9").Value, Workbooks("folder_macro.xls").Worksheets("Sheet1").Range("A10").Value, _
Workbooks("folder_macro.xls").Worksheets("Sheet1").Range("A11").Value, Workbooks("folder_macro.xls").Worksheets("Sheet1").Range("A12").Value, Workbooks("folder_macro.xls").Worksheets("Sheet1").Range("A13").Value, Workbooks("folder_macro.xls").Worksheets("Sheet1").Range("A14").Value, Workbooks("folder_macro.xls").Worksheets("Sheet1").Range("A15").Value, Workbooks("folder_macro.xls").Worksheets("Sheet1").Range("A16").Value, Workbooks("folder_macro.xls").Worksheets("Sheet1").Range("A17").Value, Workbooks("folder_macro.xls").Worksheets("Sheet1").Range("A18").Value, Workbooks("folder_macro.xls").Worksheets("Sheet1").Range("A19").Value, Workbooks("folder_macro.xls").Worksheets("Sheet1").Range("A20").Value)
For i = 0 To Workbooks("folder_macro.xls").Worksheets("Sheet1").Range("B2").Value
MkDir (dirname + "\" + team_members(i))
Next
MsgBox "Folders created...", vbInformation, "Make Folders"
End Sub
|