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 36 weeks ago
6 years 22 weeks ago
6 years 34 weeks ago
6 years 37 weeks ago
6 years 38 weeks ago
6 years 43 weeks ago
6 years 52 weeks ago
7 years 2 days ago
7 years 3 days ago
7 years 3 days ago