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  

Save As using contents of Cell in Name



 
 
Thread Tools Display Modes
  #1  
Old June 15th, 2004, 08:58 AM
NickMinUK
external usenet poster
 
Posts: n/a
Default Save As using contents of Cell in Name

Can someone help with code that changes the "save As" file name to a
combination of the original File Name + the contents of a cell, and
saves file in same folder as the original.

E.G. Original File Name= Timesheet
Cells B1= Location
Cell C1 = Date in format 3-5-2004
Cell A1 = concatenate(B1,C1)

Fle Name will therefore be "Timesheet Location 3-5-2004"

The other problem is with the date. When concatenating, how do I format
the date to avoid it looking like "Location 38051"

Any help much appreciated

Nick


---
Message posted from http://www.ExcelForum.com/

  #2  
Old June 15th, 2004, 07:14 PM
Frank Kabel
external usenet poster
 
Posts: n/a
Default Save As using contents of Cell in Name

Hi
for concatening use the formula
=B1 & " " & TEXT(C1,"M-D-YYYY")

for saving you may use a macro like
sub save_it()
dim rng as range
set rng = activeworkbook.worksheets("sheet1").range("A1")
activeworkbook.saveas rng.value
end sub


--
Regards
Frank Kabel
Frankfurt, Germany


Can someone help with code that changes the "save As" file name to a
combination of the original File Name + the contents of a cell, and
saves file in same folder as the original.

E.G. Original File Name= Timesheet
Cells B1= Location
Cell C1 = Date in format 3-5-2004
Cell A1 = concatenate(B1,C1)

Fle Name will therefore be "Timesheet Location 3-5-2004"

The other problem is with the date. When concatenating, how do I
format the date to avoid it looking like "Location 38051"

Any help much appreciated

Nick


---
Message posted from http://www.ExcelForum.com/

 




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


All times are GMT +1. The time now is 05:17 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.