Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
jatman
 
Posts: n/a
Default saving file name based on value in predetermined cell

how do i save a file based on a predetermined value in a cell.

ex. the value in cell B11 contains a date. i want that date to be the file
name that it gets saved as.

regards,

jat jaswal
  #2   Report Post  
Posted to microsoft.public.excel.misc
JB
 
Posts: n/a
Default saving file name based on value in predetermined cell

ActiveWorkbook.SaveAs Filename:=Format([b11], "yyyy_mm_dd")

Cordialy JB

  #3   Report Post  
Posted to microsoft.public.excel.misc
Bob Phillips
 
Posts: n/a
Default saving file name based on value in predetermined cell

You have to be careful not to use \ in a filename, so you cannot use the
cell Text property. Format the date yourself, in reverse order for sorting

Activeworkbook.SaveAs Filename:=Format(Range("B11").Value,"yyyymmdd")

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

"jatman" wrote in message
...
how do i save a file based on a predetermined value in a cell.

ex. the value in cell B11 contains a date. i want that date to be the

file
name that it gets saved as.

regards,

jat jaswal



  #4   Report Post  
Posted to microsoft.public.excel.misc
jatman
 
Posts: n/a
Default saving file name based on value in predetermined cell

JB/BOB:
thanx for the reply, but when i right click on the tab, view code, i cut and
paste the line code into the file and i get an error. the only change i had
to make was to match the cell properly H3:J3 (merged cells) and the date
format is dd mmm yyyy (already formated in cell) but i changed the date
format in the code to both suggestions.

i only have a few selections in the workbook for where i can enter the code.
i'm entering the line in the BeforeSave because i do not see SaveAs Filename
anywhere for options.

any other suggestions?

regards

jat jaswal

"Bob Phillips" wrote:

You have to be careful not to use \ in a filename, so you cannot use the
cell Text property. Format the date yourself, in reverse order for sorting

Activeworkbook.SaveAs Filename:=Format(Range("B11").Value,"yyyymmdd")

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

"jatman" wrote in message
...
how do i save a file based on a predetermined value in a cell.

ex. the value in cell B11 contains a date. i want that date to be the

file
name that it gets saved as.

regards,

jat jaswal




  #5   Report Post  
Posted to microsoft.public.excel.misc
Bob Phillips
 
Posts: n/a
Default saving file name based on value in predetermined cell

Not sure about the merged cell, but you seem to be adding the code to the
worksheet code module. Why there? I would have expected it as a macro, or
maybe embedded in BeforeSave event and test for SaveAs.

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

"jatman" wrote in message
...
JB/BOB:
thanx for the reply, but when i right click on the tab, view code, i cut

and
paste the line code into the file and i get an error. the only change i

had
to make was to match the cell properly H3:J3 (merged cells) and the date
format is dd mmm yyyy (already formated in cell) but i changed the date
format in the code to both suggestions.

i only have a few selections in the workbook for where i can enter the

code.
i'm entering the line in the BeforeSave because i do not see SaveAs

Filename
anywhere for options.

any other suggestions?

regards

jat jaswal

"Bob Phillips" wrote:

You have to be careful not to use \ in a filename, so you cannot use the
cell Text property. Format the date yourself, in reverse order for

sorting

Activeworkbook.SaveAs Filename:=Format(Range("B11").Value,"yyyymmdd")

--

HTH

Bob Phillips

(remove nothere from the email address if mailing direct)

"jatman" wrote in message
...
how do i save a file based on a predetermined value in a cell.

ex. the value in cell B11 contains a date. i want that date to be

the
file
name that it gets saved as.

regards,

jat jaswal








  #6   Report Post  
Posted to microsoft.public.excel.misc
a94andwi
 
Posts: n/a
Default saving file name based on value in predetermined cell


Hello.

I need a macro that copies a range to a new workbook and saves the new
workbook with a predefined name.
The predefined name should be like "name current date.xls".
I know how to create the first steps but I don't know how to use the
predefined name.

I saw this question and it might be a good place to ask this question
or am I wrong?

Please help.

/Anders


--
a94andwi
------------------------------------------------------------------------
a94andwi's Profile: http://www.excelforum.com/member.php...o&userid=21077
View this thread: http://www.excelforum.com/showthread...hreadid=541891

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
conditional cell format based on cell in same row, previous column tamiluchi Excel Worksheet Functions 7 May 3rd 06 04:11 PM
Saving file in CSV format meeta das Excel Discussion (Misc queries) 2 February 15th 06 12:41 PM
HELP| populate cell with particular value based on multiple condit doon Excel Worksheet Functions 7 February 13th 06 11:26 PM
Linking a cell to another workbook cell based on a variable name Brian Excel Discussion (Misc queries) 6 June 1st 05 11:54 PM
Using Jet to read excel file returns blank for last cell - sometim Ron Excel Discussion (Misc queries) 1 December 9th 04 08:21 AM


All times are GMT +1. The time now is 05:57 PM.

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

About Us

"It's about Microsoft Excel"