![]() |
![]() |
|
|||||||
| Excel Questions All Excel/VBA questions - formulas, macros, pivot tables, general help, etc. Please post to this forum in English only. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
New Member
Join Date: Mar 2002
Posts: 25
|
Hi,
I want to write a macro that creates directories. I want to create about 200 directories that are named based on the loop definitions. Is there a way to automate this task? |
|
|
|
|
|
#2 |
|
MrExcel MVP
Join Date: Feb 2002
Location: Sydney, Australia
Posts: 2,908
|
When you say 'loop definition' I assume you want folder names like Name 1, Name 2 and so on. Give this a go:-
Code:
Sub CreateDirectories()
Dim lngFileNum As Long
For lngFileNum = 1 To 200
MkDir "C:tempNew Folder " & lngFileNum
Next
End Sub
D [ This Message was edited by: dk on 2002-03-08 08:30 ] |
|
|
|
|
|
#3 |
|
New Member
Join Date: Mar 2002
Posts: 25
|
That helps!
thanks |
|
|
|
![]() |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
|
|