ericsmpv's blog
Create directories linked to a cel value
Submitted by ericsmpv on 27 September, 2013 - 11:35I have a tiny query.
I would like to have a script that create's a subfolders in the current folder of the workbook, linked to a value in a cellrange ( A1,A2,A3, .... would create 3 folders )
When I use next Script
Sub MakeDirs()
Dim MyRange As String
MyRange = Range("C1")
Dim vFolderList As Variant, i As Long
vFolderList = Range("I6:I" & Cells(Rows.Count, "I").End(xlUp).Row).Value
On Error Resume Next
For i = 1 To UBound(vFolderList, 1)
MkDir MyRange & vFolderList(i, 1) 'amend the directory as required (it must exist)
Next
End Sub
(cell C1 is empty)
Recent comments
5 years 42 weeks ago
6 years 28 weeks ago
6 years 40 weeks ago
6 years 43 weeks ago
6 years 44 weeks ago
6 years 49 weeks ago
7 years 5 weeks ago
7 years 6 weeks ago
7 years 6 weeks ago
7 years 6 weeks ago