A Microsoft Office (Excel, Word) forum. OfficeFrustration

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.

Go Back   Home » OfficeFrustration forum » Microsoft Excel » General Discussion
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

File name equal cell contents



 
 
Thread Tools Display Modes
  #1  
Old October 29th, 2004, 08:16 AM
-tinka
external usenet poster
 
Posts: n/a
Default 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  
Old October 29th, 2004, 08:41 AM
Frank Kabel
external usenet poster
 
Posts: n/a
Default

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  
Old October 29th, 2004, 10:09 AM
-tinka
external usenet poster
 
Posts: n/a
Default

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  
Old October 29th, 2004, 10:10 AM
-tinka
external usenet poster
 
Posts: n/a
Default

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  
Old November 2nd, 2004, 12:46 AM
drvortex
external usenet poster
 
Posts: n/a
Default


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  
Old May 25th, 2005, 03:41 PM
ynissel
external usenet poster
 
Posts: n/a
Default

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  
Old January 3rd, 2006, 10:47 PM posted to microsoft.public.excel.misc
external usenet poster
 
Posts: n/a
Default 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  
Old March 22nd, 2006, 02:09 PM posted to microsoft.public.excel.misc
external usenet poster
 
Posts: n/a
Default 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  
Old March 22nd, 2006, 05:39 PM posted to microsoft.public.excel.misc
external usenet poster
 
Posts: n/a
Default 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  
Old March 22nd, 2006, 06:07 PM posted to microsoft.public.excel.misc
external usenet poster
 
Posts: n/a
Default 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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

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


All times are GMT +1. The time now is 11:27 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.