Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.newusers
JS JS is offline
external usenet poster
 
Posts: 44
Default Macro to "save as"

Hi,

Am using excel 2003 and am wanting to create a macro, attached to a button,
that will save as a particular cell #, say A2, and then print. Have the
print down pat, but can't figure out the save as part.......
--
Thanks for the help
  #2   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 5,441
Default Macro to "save as"

What is in cell A2? Try things like these, depending on what you have and what you want to do....

ThisWorkbook.SaveAs Range("A2").Value & ".xls"
ThisWorkbook.SaveCopyAs Range("A2").Value & ".xls"
ThisWorkbook.SaveAs "C:\Folder Path\" & Range("A2").Value & ".xls", AddToMru:=True
ThisWorkbook.SaveAs "C:\Folder Path\FileBaseName " & Format(Range("A2").Value, "yy-mm-dd") & ".xls"

HTH,
Bernie
MS Excel MVP


"JS" wrote in message
...
Hi,

Am using excel 2003 and am wanting to create a macro, attached to a button,
that will save as a particular cell #, say A2, and then print. Have the
print down pat, but can't figure out the save as part.......
--
Thanks for the help



  #3   Report Post  
Posted to microsoft.public.excel.newusers
JS JS is offline
external usenet poster
 
Posts: 44
Default Macro to "save as"

Hi Bernie,

Thanks for your response. I enter a number into cell A2, and want excel to
save the worksheet as that number, and leave the original as the template.
--
Thanks again for the help


"Bernie Deitrick" wrote:

What is in cell A2? Try things like these, depending on what you have and what you want to do....

ThisWorkbook.SaveAs Range("A2").Value & ".xls"
ThisWorkbook.SaveCopyAs Range("A2").Value & ".xls"
ThisWorkbook.SaveAs "C:\Folder Path\" & Range("A2").Value & ".xls", AddToMru:=True
ThisWorkbook.SaveAs "C:\Folder Path\FileBaseName " & Format(Range("A2").Value, "yy-mm-dd") & ".xls"

HTH,
Bernie
MS Excel MVP


"JS" wrote in message
...
Hi,

Am using excel 2003 and am wanting to create a macro, attached to a button,
that will save as a particular cell #, say A2, and then print. Have the
print down pat, but can't figure out the save as part.......
--
Thanks for the help




  #4   Report Post  
Posted to microsoft.public.excel.newusers
external usenet poster
 
Posts: 5,441
Default Macro to "save as"

JS,

Then try using this - it will save in the same folder as the original template:

ThisWorkbook.SaveCopyAs ThisWorkbook.Path & "\" & Range("A2").Value & ".xls"

HTH,
Bernie
MS Excel MVP


"JS" wrote in message
...
Hi Bernie,

Thanks for your response. I enter a number into cell A2, and want excel to
save the worksheet as that number, and leave the original as the template.
--
Thanks again for the help


"Bernie Deitrick" wrote:

What is in cell A2? Try things like these, depending on what you have and what you want to do....

ThisWorkbook.SaveAs Range("A2").Value & ".xls"
ThisWorkbook.SaveCopyAs Range("A2").Value & ".xls"
ThisWorkbook.SaveAs "C:\Folder Path\" & Range("A2").Value & ".xls", AddToMru:=True
ThisWorkbook.SaveAs "C:\Folder Path\FileBaseName " & Format(Range("A2").Value, "yy-mm-dd") &
".xls"

HTH,
Bernie
MS Excel MVP


"JS" wrote in message
...
Hi,

Am using excel 2003 and am wanting to create a macro, attached to a button,
that will save as a particular cell #, say A2, and then print. Have the
print down pat, but can't figure out the save as part.......
--
Thanks for the help






  #5   Report Post  
Posted to microsoft.public.excel.newusers
JS JS is offline
external usenet poster
 
Posts: 44
Default Macro to "save as"

Hey Bernie,

Thanks for all of your help! Works perfectly.
--
Cheers

"Bernie Deitrick" wrote:

JS,

Then try using this - it will save in the same folder as the original template:

ThisWorkbook.SaveCopyAs ThisWorkbook.Path & "\" & Range("A2").Value & ".xls"

HTH,
Bernie
MS Excel MVP


"JS" wrote in message
...
Hi Bernie,

Thanks for your response. I enter a number into cell A2, and want excel to
save the worksheet as that number, and leave the original as the template.
--
Thanks again for the help


"Bernie Deitrick" wrote:

What is in cell A2? Try things like these, depending on what you have and what you want to do....

ThisWorkbook.SaveAs Range("A2").Value & ".xls"
ThisWorkbook.SaveCopyAs Range("A2").Value & ".xls"
ThisWorkbook.SaveAs "C:\Folder Path\" & Range("A2").Value & ".xls", AddToMru:=True
ThisWorkbook.SaveAs "C:\Folder Path\FileBaseName " & Format(Range("A2").Value, "yy-mm-dd") &
".xls"

HTH,
Bernie
MS Excel MVP


"JS" wrote in message
...
Hi,

Am using excel 2003 and am wanting to create a macro, attached to a button,
that will save as a particular cell #, say A2, and then print. Have the
print down pat, but can't figure out the save as part.......
--
Thanks for the help






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
a Macro to "save as" filename from a cell on the sheet and then pr gugertmk Excel Discussion (Misc queries) 0 March 31st 09 12:32 AM
Macro to Insert Current Date into cell - Macro to "Save As" Guy[_2_] Excel Worksheet Functions 4 December 12th 08 08:20 PM
"CELL("FILENAME") NOT UPDATE AFTER "SAVE AS" ACTION yossie6 Excel Discussion (Misc queries) 1 June 16th 08 12:16 PM
Macro in WB assigned to toolbar, after "save as" points to differn Activoz_Interpreting Excel Discussion (Misc queries) 1 March 16th 08 04:02 AM
"Save" and "Save As" options greyed out - "Save as Webpage" option Bill Excel Discussion (Misc queries) 0 January 16th 07 04:47 PM


All times are GMT +1. The time now is 06:41 AM.

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"