View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Norman Jones Norman Jones is offline
external usenet poster
 
Posts: 5,302
Default Saving file using data from worksheet

Hi Patrick,

Try changing your quotes:

ActiveWorkbook.SaveAs Filename:= _
"O:\PT_DRIVER_SCHED\Vacation Mark-up (PT Drivers)" _
& Worksheets("January").[Y1].Value, _
FileFormat:=xlNormal, Password:="", _
WriteResPassword:="", _
ReadOnlyRecommended:=False, _
CreateBackup:=True

---
Regards,
Norman



"Patrick Simonds" wrote in message
...
I came up with this code to save the active worksheet with a set name and
the contents of cell Y1 included in the name. But when I finish enter the
code the program highlights the word Vacation and gives me the following
error msg "Expected end of statement"

ActiveWorkbook.SaveAs Filename:= _
"O:\PT_DRIVER_SCHED\"Vacation Mark-up (PT Drivers) &
Worksheets("January").[Y1].Value", FileFormat:= _
xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=True