View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Jim15[_18_] Jim15[_18_] is offline
external usenet poster
 
Posts: 1
Default Syntax and compile error.


I am getting a compile error on the C: RESERVES saying "function not
defined". I want to create a folder called C:\RESERVES on my hard
drive and subfolders with what is in column A on my Excel spreadsheet.
We're almost there!

Thanks,

Jim

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=526198