Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
I wish to create 100 folders in c drive, the folders should be named as names written in range a1:a100 i tried somenthing like this Sub AnewOne() MkDir "C:\Kevin" MkDir "C:\Jack" End Sub I am sure there is a better way. please hepl.. Boss |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub MakeDirectories()
Dim n As Integer n = Cells(Rows.Count, 1).End(xlUp).Row For i = 1 To n MkDir (Cells(i, 1).Value) Next End Sub -- Gary''s Student - gsnu200772 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm going to guess that the path is not included with the names in the
cells... Sub MakeDirectories() Dim n As Integer n = Cells(Rows.Count, 1).End(xlUp).Row For i = 1 To n MkDir "c:\" & Cells(i, 1).Value Next End Sub Also note I removed the parentheses from around the argument to MkDir... doesn't hurt in this case, but using them when they are not required by syntax can cause errors in a lot of cases. Rick "Gary''s Student" wrote in message ... Sub MakeDirectories() Dim n As Integer n = Cells(Rows.Count, 1).End(xlUp).Row For i = 1 To n MkDir (Cells(i, 1).Value) Next End Sub -- Gary''s Student - gsnu200772 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Can I create folders in explorer from an excel list | Excel Discussion (Misc queries) | |||
Can excel automatically create folders | Excel Discussion (Misc queries) | |||
Create Folders From Excel | Excel Programming | |||
Can anyone help me Create Excel list of files in windows folders | Excel Worksheet Functions | |||
To create folders using VBA | Excel Discussion (Misc queries) |