How do I name a spreadsheet using mulitple cell values?

V

Vic49

I would like to automatically name the the file with some static text and the
values from 2 or 3 cells. For example:

I am creating a expense account and I would like the the name to be:
XYZ_Expenses_"Date"_"Amount"

Where:
XYZ_Expenses is Static test,
Date is located in cell J3,
Amount is located in cell J30

I am not very familiar with using or building macros, so any information on
how to build and run the macro and would be greatly appreciated. Thanks in
advance.

Win XP and Excel 2007
 
M

muddan madhu

Sub filesname()
Dim str As String
Set Shtn = Worksheets("Sheet1")
str = "XYZ_Expense_" & Format(Shtn.Range("A3"), "dd-mm-yyyy") & "_" &
Shtn.Range("A4")
ActiveWorkbook.SaveAs str
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top