ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Create filename based on cell contents (https://www.excelbanter.com/excel-programming/318233-create-filename-based-cell-contents.html)

Rudy W

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

Bob Phillips[_6_]

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




No Name

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



.



All times are GMT +1. The time now is 10:07 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com