how save excel page with cell data as filenam

April 19, 2011 at 07:23:07
Specs: Windows XP
I am trying to write a macro that will save the current excel page using the data in a cell as the filename. ie with an invoice template I want to use the invoice number as the file name and assign the macro to a button on the worksheet.

See More: how save excel page with cell data as filenam

Report •


#1
April 19, 2011 at 12:14:18
By "current excel page" I assume you mean "Active Workbook".

In it's simplest form it would look like this:

Sub SaveUseCellData()

    ActiveWorkbook.SaveAs Filename:= _
        "C:\Documents and Settings\user_name\Desktop\" & Range("A1") & ".xls"
        
End Sub

Click Here Before Posting Data or VBA Code ---> How To Post Data or Code.


Report •
Related Solutions


Ask Question