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
ActiveWorkbook.SaveAs Filename:=Format([b11], quot;yyyy_mm_ddquot;)
Cordialy JBYou 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(quot;B11quot;).Value,quot;yyyymmddquot;)
--
HTH
Bob Phillips
(remove nothere from the email address if mailing direct)
quot;jatmanquot; gt; wrote in message
...
gt; how do i save a file based on a predetermined value in a cell.
gt;
gt; ex. the value in cell B11 contains a date. i want that date to be the
file
gt; name that it gets saved as.
gt;
gt; regards,
gt;
gt; jat jaswal
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
quot;Bob Phillipsquot; wrote:
gt; You have to be careful not to use \ in a filename, so you cannot use the
gt; cell Text property. Format the date yourself, in reverse order for sorting
gt;
gt; Activeworkbook.SaveAs Filename:=Format(Range(quot;B11quot;).Value,quot;yyyymmddquot;)
gt;
gt; --
gt;
gt; HTH
gt;
gt; Bob Phillips
gt;
gt; (remove nothere from the email address if mailing direct)
gt;
gt; quot;jatmanquot; gt; wrote in message
gt; ...
gt; gt; how do i save a file based on a predetermined value in a cell.
gt; gt;
gt; gt; ex. the value in cell B11 contains a date. i want that date to be the
gt; file
gt; gt; name that it gets saved as.
gt; gt;
gt; gt; regards,
gt; gt;
gt; gt; jat jaswal
gt;
gt;
gt;
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)
quot;jatmanquot; gt; wrote in message
...
gt; JB/BOB:
gt; thanx for the reply, but when i right click on the tab, view code, i cut
and
gt; paste the line code into the file and i get an error. the only change i
had
gt; to make was to match the cell properly H3:J3 (merged cells) and the date
gt; format is dd mmm yyyy (already formated in cell) but i changed the date
gt; format in the code to both suggestions.
gt;
gt; i only have a few selections in the workbook for where i can enter the
code.
gt; i'm entering the line in the BeforeSave because i do not see SaveAs
Filename
gt; anywhere for options.
gt;
gt; any other suggestions?
gt;
gt; regards
gt;
gt; jat jaswal
gt;
gt; quot;Bob Phillipsquot; wrote:
gt;
gt; gt; You have to be careful not to use \ in a filename, so you cannot use the
gt; gt; cell Text property. Format the date yourself, in reverse order for
sorting
gt; gt;
gt; gt; Activeworkbook.SaveAs Filename:=Format(Range(quot;B11quot;).Value,quot;yyyymmddquot;)
gt; gt;
gt; gt; --
gt; gt;
gt; gt; HTH
gt; gt;
gt; gt; Bob Phillips
gt; gt;
gt; gt; (remove nothere from the email address if mailing direct)
gt; gt;
gt; gt; quot;jatmanquot; gt; wrote in message
gt; gt; ...
gt; gt; gt; how do i save a file based on a predetermined value in a cell.
gt; gt; gt;
gt; gt; gt; ex. the value in cell B11 contains a date. i want that date to be
the
gt; gt; file
gt; gt; gt; name that it gets saved as.
gt; gt; gt;
gt; gt; gt; regards,
gt; gt; gt;
gt; gt; gt; jat jaswal
gt; gt;
gt; gt;
gt; gt;
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 quot;name current date.xlsquot;.
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: www.excelforum.com/member.php...oamp;userid=21077
View this thread: www.excelforum.com/showthread...hreadid=541891
- Sep 10 Mon 2007 20:39
saving file name based on value in predetermined cell
close
全站熱搜
留言列表
發表留言