View Single Post
  #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