MrExcel Publishing
Your One Stop for Excel Tips & Solutions

Macro to save current file from cells


Posted by Sam on January 12, 2001 7:01 PM

Can someone help me with a macro to save my current file
with a file name from two cells? Lets say Cells A1 & A2.


Posted by Dave Hawley on January 13, 2001 12:58 AM


Hi Sam

Push Alt+F11, Insert>Module, paste in this code, change cells if needed. Push Alt+Q, Push Alt+F8, click "SaveAsCell" then Run.


Sub SaveAsCell()
ThisWorkbook.SaveAs [A1] & [A2] & ".xls"
End Sub


Hope this helps
Dave


OzGrid Business Applications