Thread: Save As Macro
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default Save As Macro

Hi,

SaveAs is an illegal sub name. Try this for your saveas line

ActiveWorkbook.SaveAs Filename:="N:\FOLDER1\" & Range("A2").Value &
Range("A3").Value & "\MyFile.xls"

Mike

"iperlovsky" wrote:

I am running the following sub routine, but I would like the new file name to
incorporate a specific cell value so that the file will always be saved in
the most current folder.

Sub SaveAs()
ActiveWorkbook.SaveAs Filename:="N:\FOLDER1\MyFile.xls"
End Sub

For example, in the modified code below I would like folders {yyyy} and
{mm-yyyy} to reference cells A2 and A3, respectively, in a specific worksheet
in the active workbook.

ActiveWorkbook.SaveAs Filename:="N:\FOLDER1\{yyyy}\{mm-yyyy}\MyFile.xls"

Thanks for the help,

IP