#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Save As

Hi gan
I am trying to save one sheet of a workbook to a new file. Currently I am using...
Sub SaveTestSheetSeparately(
Worksheets("test").Cop
ActiveWorkbook.SaveAs "test1.xls
End Su
I would like the file name to be the contents of cell B3. How do I need to modify the code
Thank
Gene
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,080
Default Save As

ActiveWorkbook.SaveAs Range("B3")

or

ActiveWorkbook.SaveAs Range("B3") & ".xls"

depending on whether the extension is included in the cell.

Be warned that unless you specify the path, your workbook may end up being
saved in a completely different directory from what you may be expecting.

--

Vasant


"Gene" wrote in message
...
Hi gang
I am trying to save one sheet of a workbook to a new file. Currently I am

using....
Sub SaveTestSheetSeparately()
Worksheets("test").Copy
ActiveWorkbook.SaveAs "test1.xls"
End Sub
I would like the file name to be the contents of cell B3. How do I need to

modify the code.
Thanks
Gene



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 391
Default Save As

sFileName = Worksheets("Sheet1").Range("B3).Value

ActiveWorkbook.SaveAs sFileName



Patrick Molloy
Microsoft Excel MVP

-----Original Message-----
Hi gang
I am trying to save one sheet of a workbook to a new

file. Currently I am using....
Sub SaveTestSheetSeparately()
Worksheets("test").Copy
ActiveWorkbook.SaveAs "test1.xls"
End Sub
I would like the file name to be the contents of cell

B3. How do I need to modify the code.
Thanks
Gene
.

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
Save, save as, page setup dimmed out in unprotected excel sheet? ccKeithJ Excel Discussion (Misc queries) 3 December 14th 07 07:07 PM
SAVE and SAVE AS options disappeared from the drop down FILE menu [email protected] Excel Discussion (Misc queries) 2 July 12th 07 09:14 AM
how to get disk icon on save button of save as dialog like 2000 RichT Excel Discussion (Misc queries) 2 March 9th 06 08:13 PM
Save Excel file - prompts to save - no Volitile functions used POWER CERTS Excel Worksheet Functions 2 November 1st 04 09:27 PM
Save As - Multiple Sheets fails to save as text file Ravee Srinivasan Excel Programming 2 November 10th 03 04:05 PM


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

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

About Us

"It's about Microsoft Excel"