A macro that can save a file?

  • Thread starter Thread starter sir_glen
  • Start date Start date
S

sir_glen

Is it possible to make a macro the will save the current spreadsheet?

I want to make a macro the will save the spreadsheet with the filenam
A2_A3.xls

So if A2 was "Bloggs" and A3 was "Joe" the file would save a
Bloggs_Joe.xls

I've allready made the macro clear certain cells but I've only don
this by using the record macro function and editing out certain part
cause I don't really understand visual basic :confused:

Thanks in advance.

Gle
 
Something like

Dim FName As String

FName = ActiveSheet.Range("a2") & "_" & ActiveSheet.Range("a3")

ActiveWorkbook.SaveAs Filename:= _
FName, FileFormat:= _
xlNormal, Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False _
, CreateBackup:=False

should do it.

Jan
 

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

Back
Top