View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
grinning_crow[_7_] grinning_crow[_7_] is offline
external usenet poster
 
Posts: 1
Default Automatically include contents of a cell in "Save As..." filename.

As far as I know there are two things you could do;

This would simply save the file automatically and not give them
chance to change the name, adding the contents of cell A1 to the end o
your specified string:

sub workbook_beforeclose(cancel as integer)

activeworkbook.saveas "Field Rating - " & sheet1.range("A1")

end sub


I'm using 2003 so not sure if this one is available in 2000, but migh
be worth a try. It will basically bring up the saveas dialog box an
suggest the concatenated result of your standard string and th
contents of cell A1:

sub workbook_beforeclose(cancel as integer)

activeworkbook.getsaveasfilename "Field Rating - "
sheet1.range("A1")

end sub


I'd recommend having a look at the help files for these methods to ge
a full idea of what can be done with them.

Hope this helps

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