Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Save Sheet and Remove from Workbook

I see questions which save an entire workbook, but I need to save a
worksheet, remove to an archive existing workbook. Each work book is a job,
so this will create a history of jobs for each of our project managers.
Active jobs in one work book and completed jobs in another. Please give me
some vba guidence. Thanks
Larry
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Save Sheet and Remove from Workbook


Hi Larry,

The simple instruction:

Activesheet.Copy

produces a new single-sheet workbook, the single sheet being a copy of the
active sheet.

At tis juncture, the new, single-sheet workbook is unsaved and is the active
workbook.

Of course, instead of Activesheet, any sheet may be specified, e.g.:

Sheets("Sheet2").Copy



---
Regards,
Norman



"South Bend Larry" wrote in
message ...
I see questions which save an entire workbook, but I need to save a
worksheet, remove to an archive existing workbook. Each work book is a
job,
so this will create a history of jobs for each of our project managers.
Active jobs in one work book and completed jobs in another. Please give
me
some vba guidence. Thanks
Larry



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Save Sheet and Remove from Workbook

That is slick, but it creates a "book 2" not add to an existing workbook.
Is there a way to slip a worksheet into an existing workbook. And what would
be the command to remove a worksheet.
Thanks

"Norman Jones" wrote:


Hi Larry,

The simple instruction:

Activesheet.Copy

produces a new single-sheet workbook, the single sheet being a copy of the
active sheet.

At tis juncture, the new, single-sheet workbook is unsaved and is the active
workbook.

Of course, instead of Activesheet, any sheet may be specified, e.g.:

Sheets("Sheet2").Copy



---
Regards,
Norman



"South Bend Larry" wrote in
message ...
I see questions which save an entire workbook, but I need to save a
worksheet, remove to an archive existing workbook. Each work book is a
job,
so this will create a history of jobs for each of our project managers.
Active jobs in one work book and completed jobs in another. Please give
me
some vba guidence. Thanks
Larry




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Save Sheet and Remove from Workbook

Hi Larry,

That is slick, but it creates a "book 2" not add to an existing workbook.
Is there a way to slip a worksheet into an existing workbook. And what
would
be the command to remove a worksheet.
Thanks


A worksheet can be copied from one workbook to another. Alternatively, a
worksheet can be moved from one workbook to another.

The following demonstrates both processes:

Sub Tester01()
Dim WB1 As Workbook
Dim WB2 As Workbook

Set WB1 = Workbooks("MyBook1.xls")
Set WB2 = Workbooks("MyBook2.xls")


'Copy a sheet from WB1 to WB2
'-------------------------------

WB1.Sheets("Sheet2").Copy _
After:=WB2.Sheets(WB2.Sheets.Count)


'Move a sheet from WB1 to WB2
'--------------------------------
WB1.Sheets("Sheet3").Move _
After:=WB2.Sheets(WB2.Sheets.Count)
End Sub


---
Regards,
Norman



"South Bend Larry" wrote in
message ...
That is slick, but it creates a "book 2" not add to an existing workbook.
Is there a way to slip a worksheet into an existing workbook. And what
would
be the command to remove a worksheet.
Thanks

"Norman Jones" wrote:


Hi Larry,

The simple instruction:

Activesheet.Copy

produces a new single-sheet workbook, the single sheet being a copy of
the
active sheet.

At tis juncture, the new, single-sheet workbook is unsaved and is the
active
workbook.

Of course, instead of Activesheet, any sheet may be specified, e.g.:

Sheets("Sheet2").Copy



---
Regards,
Norman



"South Bend Larry" wrote in
message ...
I see questions which save an entire workbook, but I need to save a
worksheet, remove to an archive existing workbook. Each work book is a
job,
so this will create a history of jobs for each of our project managers.
Active jobs in one work book and completed jobs in another. Please
give
me
some vba guidence. Thanks
Larry






  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Save Sheet and Remove from Workbook

Thanks that was just what I was look for.
Larry

"Norman Jones" wrote:

Hi Larry,

That is slick, but it creates a "book 2" not add to an existing workbook.
Is there a way to slip a worksheet into an existing workbook. And what
would
be the command to remove a worksheet.
Thanks


A worksheet can be copied from one workbook to another. Alternatively, a
worksheet can be moved from one workbook to another.

The following demonstrates both processes:

Sub Tester01()
Dim WB1 As Workbook
Dim WB2 As Workbook

Set WB1 = Workbooks("MyBook1.xls")
Set WB2 = Workbooks("MyBook2.xls")


'Copy a sheet from WB1 to WB2
'-------------------------------

WB1.Sheets("Sheet2").Copy _
After:=WB2.Sheets(WB2.Sheets.Count)


'Move a sheet from WB1 to WB2
'--------------------------------
WB1.Sheets("Sheet3").Move _
After:=WB2.Sheets(WB2.Sheets.Count)
End Sub


---
Regards,
Norman



"South Bend Larry" wrote in
message ...
That is slick, but it creates a "book 2" not add to an existing workbook.
Is there a way to slip a worksheet into an existing workbook. And what
would
be the command to remove a worksheet.
Thanks

"Norman Jones" wrote:


Hi Larry,

The simple instruction:

Activesheet.Copy

produces a new single-sheet workbook, the single sheet being a copy of
the
active sheet.

At tis juncture, the new, single-sheet workbook is unsaved and is the
active
workbook.

Of course, instead of Activesheet, any sheet may be specified, e.g.:

Sheets("Sheet2").Copy



---
Regards,
Norman



"South Bend Larry" wrote in
message ...
I see questions which save an entire workbook, but I need to save a
worksheet, remove to an archive existing workbook. Each work book is a
job,
so this will create a history of jobs for each of our project managers.
Active jobs in one work book and completed jobs in another. Please
give
me
some vba guidence. Thanks
Larry








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default Save Sheet and Remove from Workbook

I keep getting "Subscript out of Range" on the move statement. I have tried
substituting "Sheet4" for the sheet name of "22085", I know this error
normally occurs when the sheet or file does not exist so it returns a value
of 0, but all exists.
Please help.
Thanks

Dim CJobs As Workbook
Dim OJobs As Workbook

Workbooks.Open ("c:\MikeClosedJobs.xls")
Set CJobs = Workbooks("MikeClosedJobs.xls")
Set OJobs = Workbooks("Mike.xls")
Worksheets("22085").Move After:=CJobs.Worksheets(CJobs.Worksheets.Count)
Workbooks("MikeClosedJobs.xls").Close


"South Bend Larry" wrote:

Thanks that was just what I was look for.
Larry

"Norman Jones" wrote:

Hi Larry,

That is slick, but it creates a "book 2" not add to an existing workbook.
Is there a way to slip a worksheet into an existing workbook. And what
would
be the command to remove a worksheet.
Thanks


A worksheet can be copied from one workbook to another. Alternatively, a
worksheet can be moved from one workbook to another.

The following demonstrates both processes:

Sub Tester01()
Dim WB1 As Workbook
Dim WB2 As Workbook

Set WB1 = Workbooks("MyBook1.xls")
Set WB2 = Workbooks("MyBook2.xls")


'Copy a sheet from WB1 to WB2
'-------------------------------

WB1.Sheets("Sheet2").Copy _
After:=WB2.Sheets(WB2.Sheets.Count)


'Move a sheet from WB1 to WB2
'--------------------------------
WB1.Sheets("Sheet3").Move _
After:=WB2.Sheets(WB2.Sheets.Count)
End Sub


---
Regards,
Norman



"South Bend Larry" wrote in
message ...
That is slick, but it creates a "book 2" not add to an existing workbook.
Is there a way to slip a worksheet into an existing workbook. And what
would
be the command to remove a worksheet.
Thanks

"Norman Jones" wrote:


Hi Larry,

The simple instruction:

Activesheet.Copy

produces a new single-sheet workbook, the single sheet being a copy of
the
active sheet.

At tis juncture, the new, single-sheet workbook is unsaved and is the
active
workbook.

Of course, instead of Activesheet, any sheet may be specified, e.g.:

Sheets("Sheet2").Copy



---
Regards,
Norman



"South Bend Larry" wrote in
message ...
I see questions which save an entire workbook, but I need to save a
worksheet, remove to an archive existing workbook. Each work book is a
job,
so this will create a history of jobs for each of our project managers.
Active jobs in one work book and completed jobs in another. Please
give
me
some vba guidence. Thanks
Larry






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
workbook creates a backup evertime I save it. how to remove? Roger Excel Worksheet Functions 0 September 7th 07 09:56 PM
Save Sheet as Workbook salonowiec Excel Discussion (Misc queries) 2 June 26th 07 04:03 PM
Select sheet tabs in workbook & save to separate workbook files stratocaster Excel Worksheet Functions 2 March 1st 06 03:35 PM
Can I only save one sheet out of the workbook? PeterM Excel Discussion (Misc queries) 4 September 1st 05 04:42 AM
Save to sheet 2 in workbook AMK Excel Programming 1 June 21st 05 04:38 AM


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