View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
jeramie[_2_] jeramie[_2_] is offline
external usenet poster
 
Posts: 18
Default script to change filename

thanks! I'll add this in and see how it works.

"Tom Ogilvy" wrote:

To rename an Excel Workbook, you have to save it as the new name

With ActiveWorkbook
.SaveAs Filename:=.Path & "\" & _
Worksheets("Sheet1").Range("A1").Text & _
Worksheets("Sheet1").Range("B9").Text & _
".xls"
End With


To maintain the date, after getting the date you want, change it to a
constant with:

With Worksheets("Sheet1").Range("A1")
.Value = .Value
End With

or skip the formula and do

With Worksheets("Sheet1").Range("A1")
.Value = Date
End With

--
Regards,
Tom Ogilvy



"jeramie" wrote in message
...
i am looking for a script or macro that change the name of a werksheet

file
to the contents of two cells(one is a date, the other, a users name), the
first time the file is saved. the file is opened from a template named

daily
reports.xlt. Also, i can get the current date to show in the appropriate
cell.... but when i open the file a week later, the date changes to the
current date.