View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default Syntax and compile error.

Dim Cou As Long: Dim foldersys As String: Dim filesys As Variant

But that's way too ugly for even me.

Jim Thomlinson wrote:

You can't use dim twice on the same line. Try either of the two following

dim cou as integer
Dim FolderStr as string
dim FileSys as variant

or

dim cou as integer, FolderStr as string, FileSys
--
HTH...

Jim Thomlinson

"Jim15" wrote:


I am getting a syntax and compile error on the dim cou .... line. Any
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 Sub


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



--

Dave Peterson