Thread: Saving files
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
speidlbacsi[_3_] speidlbacsi[_3_] is offline
external usenet poster
 
Posts: 1
Default Saving files

try this; you may define variables more precisely

Sub SavContinous()

Y = "C:\temp\FileName" ' can be whichever existing folder
For Nr = 1 To 9999

Fname = Y & Nr & ".xls"

Set fs = CreateObject("Scripting.FileSystemObject")
A = fs.FileExists(Fname)

If A = False Then GoTo rutin

Next Nr

rutin:

ActiveWorkbook.SaveAs Filename:=Fname

End Sub


---
Message posted from http://www.ExcelForum.com/