Saving Cell value as filename

  • Thread starter Thread starter Kathy B
  • Start date Start date
K

Kathy B

I'm working on a project where I want to be able to take the text (for
example RICH RD SE) that is in cell C1 and by use of macro or code
save the workbook as "C1".xls (in this example, RICH RD SE.xls),
close the current workbook with the new name and then open a new copy
of the original.

I managed to get it to work ONCE, but when I ran the macro on
subsequent workbooks, it would try to name them EACH "RICH RD SE.xls"
..

I am assuming that I need to use some sort of variable statement, but
being the extreme novice in VBA, I can't quite figure out the syntax.

Any ideas?
 
Kathy,

Try something like

ThisWorkbook.SaveAs filename:=Range("C1") & ".xls"


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com (e-mail address removed)
 
Back
Top