Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Generate document folders for Excel list.


I have a need to generate separate folders in a directory using a colum
list in Excel. I want the program to take an Excel file wit
descriptions in each row (column A only) and generate separate folder
with the descriptions being the folder name. Would generate anywher
from 50 - 100 (or more) directory folders.

Thanks,

Ji

--
Jim1
-----------------------------------------------------------------------
Jim15's Profile: http://www.excelforum.com/member.php...fo&userid=2630
View this thread: http://www.excelforum.com/showthread.php?threadid=51194

  #2   Report Post  
Posted to microsoft.public.excel.programming
ben ben is offline
external usenet poster
 
Posts: 67
Default Generate document folders for Excel list.

sub createfolders()
dim cou as integer,Dim FolderStr as string, FileSys
for cou = 1 to activesheet.usedrange.rows.count
forlderstr = activesheet.cells(cou,1)
Set FileSys = CreateObject("Scripting.FileSystemObject")
FileSys.createfolder "C:\"+folderstr
next
end sub

replace "C:\" with appropriate drive and subfolder where they will be placed
also, certain characters are illegal in folder names, and if the folder
already exists the createfolder method will fail.
Xl2003



--
When you lose your mind, you free your life.
Ever Notice how we use '' for comments in our posts even if they aren''t
expected to go into the code?


"Jim15" wrote:


I have a need to generate separate folders in a directory using a column
list in Excel. I want the program to take an Excel file with
descriptions in each row (column A only) and generate separate folders
with the descriptions being the folder name. Would generate anywhere
from 50 - 100 (or more) directory folders.

Thanks,

Jim


--
Jim15
------------------------------------------------------------------------
Jim15's Profile: http://www.excelforum.com/member.php...o&userid=26300
View this thread: http://www.excelforum.com/showthread...hreadid=511949


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Generate document folders for Excel list.


In addition, I would like the program to label the folders starting from
row 1 and label them like 1_foldername, 2_foldername, 3_foldername,
4_foldername, etc.

The row names are in importance of information and I do not want them
arranged alphabetically.

Thanks,

Jim


--
Jim15
------------------------------------------------------------------------
Jim15's Profile: http://www.excelforum.com/member.php...o&userid=26300
View this thread: http://www.excelforum.com/showthread...hreadid=511949

  #4   Report Post  
Posted to microsoft.public.excel.programming
ben ben is offline
external usenet poster
 
Posts: 67
Default Generate document folders for Excel list.

use this instead then




sub createfolders()
dim cou as integer,Dim FolderStr as string, FileSys
for cou = 1 to activesheet.usedrange.rows.count
forlderstr = Format(Trim(Str(cou)), "00#") + "_" + activesheet.cells(cou,1)
Set FileSys = CreateObject("Scripting.FileSystemObject")
FileSys.createfolder "C:\"+folderstr
next
end sub


this will organize numerically and not by text

--
When you lose your mind, you free your life.
Ever Notice how we use '' for comments in our posts even if they aren''t
expected to go into the code?


"ben" wrote:

sub createfolders()
dim cou as integer,Dim FolderStr as string, FileSys
for cou = 1 to activesheet.usedrange.rows.count
forlderstr = activesheet.cells(cou,1)
Set FileSys = CreateObject("Scripting.FileSystemObject")
FileSys.createfolder "C:\"+folderstr
next
end sub

replace "C:\" with appropriate drive and subfolder where they will be placed
also, certain characters are illegal in folder names, and if the folder
already exists the createfolder method will fail.
Xl2003



--
When you lose your mind, you free your life.
Ever Notice how we use '' for comments in our posts even if they aren''t
expected to go into the code?


"Jim15" wrote:


I have a need to generate separate folders in a directory using a column
list in Excel. I want the program to take an Excel file with
descriptions in each row (column A only) and generate separate folders
with the descriptions being the folder name. Would generate anywhere
from 50 - 100 (or more) directory folders.

Thanks,

Jim


--
Jim15
------------------------------------------------------------------------
Jim15's Profile: http://www.excelforum.com/member.php...o&userid=26300
View this thread: http://www.excelforum.com/showthread...hreadid=511949


  #5   Report Post  
Posted to microsoft.public.excel.programming
ben ben is offline
external usenet poster
 
Posts: 67
Default Generate document folders for Excel list.

oops
this line
forlderstr = Format(Trim(Str(cou)), "00#") + "_" + activesheet.cells(cou,1)
should read
folderstr = Format(Trim(Str(cou)), "00#") + "_" + activesheet.cells(cou,1)
my bad, typo....

--
When you lose your mind, you free your life.
Ever Notice how we use '' for comments in our posts even if they aren''t
expected to go into the code?


"ben" wrote:

use this instead then




sub createfolders()
dim cou as integer,Dim FolderStr as string, FileSys
for cou = 1 to activesheet.usedrange.rows.count
forlderstr = Format(Trim(Str(cou)), "00#") + "_" + activesheet.cells(cou,1)
Set FileSys = CreateObject("Scripting.FileSystemObject")
FileSys.createfolder "C:\"+folderstr
next
end sub


this will organize numerically and not by text

--
When you lose your mind, you free your life.
Ever Notice how we use '' for comments in our posts even if they aren''t
expected to go into the code?


"ben" wrote:

sub createfolders()
dim cou as integer,Dim FolderStr as string, FileSys
for cou = 1 to activesheet.usedrange.rows.count
forlderstr = activesheet.cells(cou,1)
Set FileSys = CreateObject("Scripting.FileSystemObject")
FileSys.createfolder "C:\"+folderstr
next
end sub

replace "C:\" with appropriate drive and subfolder where they will be placed
also, certain characters are illegal in folder names, and if the folder
already exists the createfolder method will fail.
Xl2003



--
When you lose your mind, you free your life.
Ever Notice how we use '' for comments in our posts even if they aren''t
expected to go into the code?


"Jim15" wrote:


I have a need to generate separate folders in a directory using a column
list in Excel. I want the program to take an Excel file with
descriptions in each row (column A only) and generate separate folders
with the descriptions being the folder name. Would generate anywhere
from 50 - 100 (or more) directory folders.

Thanks,

Jim


--
Jim15
------------------------------------------------------------------------
Jim15's Profile: http://www.excelforum.com/member.php...o&userid=26300
View this thread: http://www.excelforum.com/showthread...hreadid=511949




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Generate document folders for Excel list.


I am getting a syntax and compile error on the dim cou .... line. An
suggestions?

Thanks,

Jim

Sub createfolders()
'
'
dim cou as integer,Dim FolderStr as string, FileSys
For cou = 1 To ActiveSheet.UsedRange.Rows.Count
FolderStr = Format(Trim(Str(cou)), "00#") + "_"
ActiveSheet.Cells(cou, 1)
Set FileSys = CreateObject("Scripting.FileSystemObject")
FileSys.createfolder C:\ + RESERVES
Next
End Su

--
Jim1
-----------------------------------------------------------------------
Jim15's Profile: http://www.excelforum.com/member.php...fo&userid=2630
View this thread: http://www.excelforum.com/showthread.php?threadid=51194

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Generate document folders for Excel list.


Thanks for the assistance. I am know getting an error on the line right
before the "Next" line. I am trying to create a folder called
C:\RESERVES on the hard drive with subfolders as listed in column A.

Sub createfolders()
'
' CreateFolders Macro
' Macro recorded 3/22/2006 by JBW
'
Dim cou As Integer, FolderStr As String, FileSys
For cou = 1 To ActiveSheet.UsedRange.Rows.Count
FolderStr = Format(Trim(Str(cou)), "00#") + "_" +
ActiveSheet.Cells(cou, 1)
Set FileSys = CreateObject("Scripting.FileSystemObject")
FileSys.createfolder C:\ + RESERVES
Next
End Sub


--
Jim15
------------------------------------------------------------------------
Jim15's Profile: http://www.excelforum.com/member.php...o&userid=26300
View this thread: http://www.excelforum.com/showthread...hreadid=511949

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I create folders in explorer from an excel list njmcr Excel Discussion (Misc queries) 5 February 28th 13 12:22 PM
Please help to list folders and subfolders tree in Excel or Word observer[_2_] Excel Discussion (Misc queries) 3 March 18th 09 03:42 PM
List Folders using Excel Andibevan[_4_] Excel Programming 3 December 15th 05 09:44 AM
Can anyone help me Create Excel list of files in windows folders solrac1956 Excel Worksheet Functions 1 November 28th 05 11:07 PM
Creating folders and subfolders from excel file list afaubert Excel Discussion (Misc queries) 4 November 8th 05 11:44 PM


All times are GMT +1. The time now is 06:53 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"