If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
File name equal cell contents
Is it possible to make an Excel (2003) template (or a macro in the template)
to save a file with a specific cell-contents as file name? For example an invoice-template where a cell contains the invoice number. I want it to automatically save the file as "invoice-number".xls in default file location. Thanks... :-) |
#2
|
|||
|
|||
Hi
in a macro sub save_it() dim fname with activeworkbook fname = .worksheets("sheet1").range("A1").value & ".xls" ..saveas fname end with end sub "-tinka" wrote: Is it possible to make an Excel (2003) template (or a macro in the template) to save a file with a specific cell-contents as file name? For example an invoice-template where a cell contains the invoice number. I want it to automatically save the file as "invoice-number".xls in default file location. Thanks... :-) |
#3
|
|||
|
|||
Thanks!!
Just what I was looking for! "Frank Kabel" wrote: Hi in a macro sub save_it() dim fname with activeworkbook fname = .worksheets("sheet1").range("A1").value & ".xls" .saveas fname end with end sub "-tinka" wrote: Is it possible to make an Excel (2003) template (or a macro in the template) to save a file with a specific cell-contents as file name? For example an invoice-template where a cell contains the invoice number. I want it to automatically save the file as "invoice-number".xls in default file location. Thanks... :-) |
#4
|
|||
|
|||
Thanks!
Just what I was looking for! "Frank Kabel" wrote: Hi in a macro sub save_it() dim fname with activeworkbook fname = .worksheets("sheet1").range("A1").value & ".xls" .saveas fname end with end sub "-tinka" wrote: Is it possible to make an Excel (2003) template (or a macro in the template) to save a file with a specific cell-contents as file name? For example an invoice-template where a cell contains the invoice number. I want it to automatically save the file as "invoice-number".xls in default file location. Thanks... :-) |
#5
|
|||
|
|||
I'm attempting the same thing; however I have a few other options. 1. I want to get the fname from a particular Workbook/Worksheet/Cell. 2. I also want to save the document as a webpage instead of a .xls file. 3. The worksheet that I'm saving contains charts ONLY. No numbers are located on this sheet...only charts. I would greatly appreciate the help. Thanks. This is what I attempted using the above information. But getting problems. Sub save_it() Dim fname With ActiveWorkbook fname = .ActiveWorkbook("2004_Fixes").Worksheets("Sheet2") .Range("J5").Value & ".xls" .saveas "C:\Documents and Settings\Drvortex\Desktop\fname.htm" End With End Sub -- drvortex ------------------------------------------------------------------------ drvortex's Profile: http://www.excelforum.com/member.php...o&userid=15896 View this thread: http://www.excelforum.com/showthread...hreadid=273529 |
#6
|
|||
|
|||
One more Q. on the same lines. How do I save it as a PDF - with the filename
being a specific cell ? Thanks, Yosef "drvortex" wrote: I'm attempting the same thing; however I have a few other options. 1. I want to get the fname from a particular Workbook/Worksheet/Cell. 2. I also want to save the document as a webpage instead of a .xls file. 3. The worksheet that I'm saving contains charts ONLY. No numbers are located on this sheet...only charts. I would greatly appreciate the help. Thanks. This is what I attempted using the above information. But getting problems. Sub save_it() Dim fname With ActiveWorkbook fname = .ActiveWorkbook("2004_Fixes").Worksheets("Sheet2") .Range("J5").Value & ".xls" .saveas "C:\Documents and Settings\Drvortex\Desktop\fname.htm" End With End Sub -- drvortex ------------------------------------------------------------------------ drvortex's Profile: http://www.excelforum.com/member.php...o&userid=15896 View this thread: http://www.excelforum.com/showthread...hreadid=273529 |
#7
|
|||
|
|||
File name equal cell contents
Frank,
I need help... i tried pasteing the code below but nothing happens. can you help me out. i am trying to set up auto save as at close of workbook. file name should equal contents of merged cell I10:J10 on sheet2. this save as is important because it is the customer number which i need for searching as customer list grows. also i need to place an auto date that is not volitile in merged cell I1:J1 this is needed to generate the customer number in the first place... right now i am using Ctrl + ; to place the date in the cell. this is ok if i must but with expected increase in customers i could save a lot of time if it just was there...lol i am running xp with excel (office pro) '03. "Frank Kabel" wrote: Hi in a macro sub save_it() dim fname with activeworkbook fname = .worksheets("sheet1").range("A1").value & ".xls" .saveas fname end with end sub "-tinka" wrote: Is it possible to make an Excel (2003) template (or a macro in the template) to save a file with a specific cell-contents as file name? For example an invoice-template where a cell contains the invoice number. I want it to automatically save the file as "invoice-number".xls in default file location. Thanks... :-) |
#8
|
|||
|
|||
File name equal cell contents
Is there a way to have two cells in the range, so the the two cells make up
the file name? "Frank Kabel" wrote: Hi in a macro sub save_it() dim fname with activeworkbook fname = .worksheets("sheet1").range("A1").value & ".xls" .saveas fname end with end sub "-tinka" wrote: Is it possible to make an Excel (2003) template (or a macro in the template) to save a file with a specific cell-contents as file name? For example an invoice-template where a cell contains the invoice number. I want it to automatically save the file as "invoice-number".xls in default file location. Thanks... :-) |
#9
|
|||
|
|||
File name equal cell contents
fname = .worksheets("sheet1").range("A1").value & _
.worksheets("sheet2").range("z99").value & _ ".xls" You could use the same sheet and adjacent cells, too. Petester wrote: Is there a way to have two cells in the range, so the the two cells make up the file name? "Frank Kabel" wrote: Hi in a macro sub save_it() dim fname with activeworkbook fname = .worksheets("sheet1").range("A1").value & ".xls" .saveas fname end with end sub "-tinka" wrote: Is it possible to make an Excel (2003) template (or a macro in the template) to save a file with a specific cell-contents as file name? For example an invoice-template where a cell contains the invoice number. I want it to automatically save the file as "invoice-number".xls in default file location. Thanks... :-) -- Dave Peterson |
#10
|
|||
|
|||
File name equal cell contents
Thanks for the information. What would be the full code for this so I can
copy and paste or how could I fix the following code that works with a ctrl-s. Sub Macro1() ActiveWorkbook.SaveAs Filename:="C:\" & Range("I5").Value & ".xls", _ FileFormat:=xlNormal, _ Password:="", _ WriteResPassword:="", _ ReadOnlyRecommended:=False, _ CreateBackup:=False End Sub "Dave Peterson" wrote: fname = .worksheets("sheet1").range("A1").value & _ .worksheets("sheet2").range("z99").value & _ ".xls" You could use the same sheet and adjacent cells, too. Petester wrote: Is there a way to have two cells in the range, so the the two cells make up the file name? "Frank Kabel" wrote: Hi in a macro sub save_it() dim fname with activeworkbook fname = .worksheets("sheet1").range("A1").value & ".xls" .saveas fname end with end sub "-tinka" wrote: Is it possible to make an Excel (2003) template (or a macro in the template) to save a file with a specific cell-contents as file name? For example an invoice-template where a cell contains the invoice number. I want it to automatically save the file as "invoice-number".xls in default file location. Thanks... :-) -- Dave Peterson |
|
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Cell Contents Saved in File Name? | Laurie Pasion | Worksheet Functions | 1 | August 3rd, 2004 02:20 AM |
You do not have exclusive access... ERROR | Robin | General Discussion | 1 | July 6th, 2004 01:18 AM |
Unsafe Attachments | Ron | Installation & Setup | 2 | June 9th, 2004 01:55 AM |