Create filename based on cell contents

  • Thread starter Thread starter Rudy W
  • Start date Start date
R

Rudy W

This is something I figured out once before, but for the
life of me I can't remember how to do it anymore....

I have a workbook set up to retrieve data from a Remedy
Ticket database. I have my refresh code and auto
generation of formulas down with no problem. What I need
to do is to be able to run a macro that will save the
file with the current data to a filename based on the
contents of a cell (for ex. B1 might equal "Open Tickets
12-2-04", the date is computed with a NOW function). I
can get this to work with a static file name, putting it
all in a Workbook Open macro, and having the workbook run
on a schedule, but I need the filename as displayed in
cell B1, so I we can retain some historical snapshots as
they occur.

Any ideas.....

Thanks,
Rudy
 
Workbooks.Open Filename:=Range("B1").Value & ".xls"

--

HTH

RP
(remove nothere from the email address if mailing direct)
 
Thanks for the assist...

I was able to take some of your syntax and insert it as
follows to get the job done:

ActiveWorkbook.SaveAs Filename:=Range("B1").Value
& ".xls", FileFormat:=xlNormal, _
Password:="", WriteResPassword:="",
ReadOnlyRecommended:=False, _
CreateBackup:=False
 

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