Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Create filename based on cell contents
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Create filename based on cell contents
Workbooks.Open Filename:=Range("B1").Value & ".xls"
-- HTH RP (remove nothere from the email address if mailing direct) "Rudy W" wrote in message ... 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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Create filename based on cell contents
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 -----Original Message----- Workbooks.Open Filename:=Range("B1").Value & ".xls" -- HTH RP (remove nothere from the email address if mailing direct) "Rudy W" wrote in message ... 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 . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Way to create a note based on the contents entered in a cell? | Excel Discussion (Misc queries) | |||
Create filename based on cell contents | Excel Worksheet Functions | |||
How to include the contents of a cell in a filename | Excel Programming | |||
Set Saveas Filename from Cell Contents Using VBA | Excel Programming | |||
cell contents as filename | Excel Programming |