dj44
03-20-2017, 10:10 AM
Morning folks:)
I am trying to Select a range and create new folders from that range
I am using a input box to hold my range.
Somethings not right
Sub MakeFolders()
On Error Resume Next
Dim rng As Range, cell As Range, path As String
LastRow = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row
' input box for selecting range of cells in excel
Set rng = Application.Selection
Set rng = Application.InputBox("Range", xTitleId, rng.Address, Type:=8)
Set rng = Application.InputBox("Range", ActiveSheet.Range)
'Set rng = Application.InputBox("Range", xTitleId, rng)
'Set rng = ActiveSheet.Range("F2:F1050")
path = "C:\Users\DJ\Desktop\New Folders\"
For Each cell In rng
MkDir path & cell
Next
Set rng = Nothing
Set cell = Nothing
http://windowssecrets.com/forums/showthread.php/173290-Excel-to-folders
End Sub
Can some one please take a look at my input box
i appreciate your help thank you
I am trying to Select a range and create new folders from that range
I am using a input box to hold my range.
Somethings not right
Sub MakeFolders()
On Error Resume Next
Dim rng As Range, cell As Range, path As String
LastRow = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row
' input box for selecting range of cells in excel
Set rng = Application.Selection
Set rng = Application.InputBox("Range", xTitleId, rng.Address, Type:=8)
Set rng = Application.InputBox("Range", ActiveSheet.Range)
'Set rng = Application.InputBox("Range", xTitleId, rng)
'Set rng = ActiveSheet.Range("F2:F1050")
path = "C:\Users\DJ\Desktop\New Folders\"
For Each cell In rng
MkDir path & cell
Next
Set rng = Nothing
Set cell = Nothing
http://windowssecrets.com/forums/showthread.php/173290-Excel-to-folders
End Sub
Can some one please take a look at my input box
i appreciate your help thank you