Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 77
Default Saving One Sheet as One Workbook

Hi all

This macro saves all sheets in my workbook, what code do I need to save the
sheet as One workbook, save a workbook with just that one sheet in it.

Public Sub BobsSaveAs()
Const PATH As String = "c:\test\"
With ActiveWorkbook
..SaveAs Filename:=PATH & _
..Sheets("Test1").Range("G1").Value & ".xls"
End With
End Sub

Still learning

Thanks in advance

Dave


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default Saving One Sheet as One Workbook

Assuming I understood you correctly, you want the sheet "Test1" to be the
only sheet in a new workbook, and save that new workbook instead. Try this:

Sub SaveOneSheet()
Dim Sht As Worksheet
Const PATH As String = "C:\test\"

Set Sht = ActiveWorkbook.Sheets("Test1")
Sht.Select
Sht.Copy
ActiveWorkbook.SaveAs Filename:= _
PATH & Sht.Range("G1") & ".xls", FileFormat:=xlNormal
End Sub

--------
Cheers,
Anony


"DaveM" wrote:

Hi all

This macro saves all sheets in my workbook, what code do I need to save the
sheet as One workbook, save a workbook with just that one sheet in it.

Public Sub BobsSaveAs()
Const PATH As String = "c:\test\"
With ActiveWorkbook
..SaveAs Filename:=PATH & _
..Sheets("Test1").Range("G1").Value & ".xls"
End With
End Sub

Still learning

Thanks in advance

Dave



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Saving One Sheet as One Workbook

basically all you need is

Sub test()
Const fPATH As String = "c:\test\"
Worksheets("test1").Copy
ActiveWorkbook.SaveAs fPATH & Sheets("Test1").Range("G1").Value & ".xls"
End Sub


--


Gary


"DaveM" wrote in message
. uk...
Hi all

This macro saves all sheets in my workbook, what code do I need to save the
sheet as One workbook, save a workbook with just that one sheet in it.

Public Sub BobsSaveAs()
Const PATH As String = "c:\test\"
With ActiveWorkbook
.SaveAs Filename:=PATH & _
.Sheets("Test1").Range("G1").Value & ".xls"
End With
End Sub

Still learning

Thanks in advance

Dave



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 77
Default Saving One Sheet as One Workbook

Thanks guys, All the best

"Gary Keramidas" <GKeramidasATmsn.com wrote in message
...
basically all you need is

Sub test()
Const fPATH As String = "c:\test\"
Worksheets("test1").Copy
ActiveWorkbook.SaveAs fPATH & Sheets("Test1").Range("G1").Value & ".xls"
End Sub


--


Gary


"DaveM" wrote in message
. uk...
Hi all

This macro saves all sheets in my workbook, what code do I need to save
the sheet as One workbook, save a workbook with just that one sheet in
it.

Public Sub BobsSaveAs()
Const PATH As String = "c:\test\"
With ActiveWorkbook
.SaveAs Filename:=PATH & _
.Sheets("Test1").Range("G1").Value & ".xls"
End With
End Sub

Still learning

Thanks in advance

Dave





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
saving a sheet in a new workbook steve Excel Programming 4 November 29th 05 04:22 PM
Saving a sheet in a workbook as .csv but not changing workbook name gloryofbach[_4_] Excel Programming 3 October 30th 05 08:50 PM
Saving one sheet within a workbook David Vollmer Excel Discussion (Misc queries) 2 September 14th 05 06:04 PM
saving sheet as new workbook Nigel Excel Programming 1 August 12th 05 02:35 AM
Saving only 1 sheet of a workbook Jay Wilson Excel Programming 4 February 2nd 04 04:38 PM


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