Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default How do I save a single worksheet to a different file using VBA 03

I am converting an old Excel 4 macro to VBA and I want to save single
worksheet to a new .xls file. The old command was
=SAVE.AS(path&CELL("contents",Invoice!$H$2),1,"",F ALSE,"",TRUE). I am using
Excel 2003 and VBA v6.5.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 468
Default How do I save a single worksheet to a different file using VBA 03

Here's a start...

Sub Macro1()
fName = Sheets("Invoice").Range("$H$2").Value
Set NewBook = Workbooks.Add
NewBook.SaveAs Filename:=fName
End Sub

"Alpineskier" wrote:

I am converting an old Excel 4 macro to VBA and I want to save single
worksheet to a new .xls file. The old command was
=SAVE.AS(path&CELL("contents",Invoice!$H$2),1,"",F ALSE,"",TRUE). I am using
Excel 2003 and VBA v6.5.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default How do I save a single worksheet to a different file using VBA

the new workbook in JMay code will create an empty workbook. the code below
will save the current workbook to a new filename.

Sub Macro1()
Folder = activeworkbook.path
fName = Sheets("Invoice").Range("$H$2").Value
Thisworkbook.SaveAs Filename:=Folder & "\" & fName
End Sub

"Alpineskier" wrote:

I am converting an old Excel 4 macro to VBA and I want to save single
worksheet to a new .xls file. The old command was
=SAVE.AS(path&CELL("contents",Invoice!$H$2),1,"",F ALSE,"",TRUE). I am using
Excel 2003 and VBA v6.5.


"JMay" wrote:

Here's a start...

Sub Macro1()
fName = Sheets("Invoice").Range("$H$2").Value
Set NewBook = Workbooks.Add
NewBook.SaveAs Filename:=fName
End Sub

"Alpineskier" wrote:

I am converting an old Excel 4 macro to VBA and I want to save single
worksheet to a new .xls file. The old command was
=SAVE.AS(path&CELL("contents",Invoice!$H$2),1,"",F ALSE,"",TRUE). I am using
Excel 2003 and VBA v6.5.

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 as single file webpage dd Excel Programming 0 January 17th 07 12:34 PM
Save Single Worksheet craig arnold Excel Programming 1 June 14th 06 03:03 PM
How to save a single worksheet as worksheet name in new folder?? Simon Lloyd[_718_] Excel Programming 4 May 16th 06 03:12 PM
Save a single worksheet in Excel as a single file. Dakota New Users to Excel 4 February 22nd 06 04:46 PM
Save single worksheet? Mat Excel Programming 3 September 27th 03 07:00 PM


All times are GMT +1. The time now is 04:53 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"