View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Steven North Steven North is offline
external usenet poster
 
Posts: 2
Default Automate File Naming Function in sequence

I created a module and inserted the code into the template.

I've inserted the code into a new module, (Nothing happened)
Inserted the code in the workbook area, nothing happened.
Inserted the code into the Sheet name area and still nothing happened.

Actually, what i might do is put it in the macro when I open up the
sheet via the toolbars.

Sub GetNewFileName()
Dim NFile As Integer, FNo As Long
NFile = FreeFile()
Open "C:\Zemd.Txt" For Input As #NFile
Input #NFile, FNo
Close #NFile
Open "C:\Zemd.Txt" For Output As #NFile
Print #NFile, FNo + 1
Close #NFile

ActiveWorkbook.SaveAs Filename:="H:\REGISTRATIONS\ZEMD\DAILY
SUMMARY\ZEMD" & FNo

End Sub



*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!