Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default How to activate original workbook?

I'm copying one sheet to an empty workbook with this code:

Sheets("Exported data").Copy

This opens a new workbook beautifully. After this is done I want to
return to the original workbook and hide the sheet "Exported data". How
can this be done?

Regards,

S

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 644
Default How to activate original workbook?

Dim wb1 as Workbook
Set wb1 = ActiveWorkbook
Sheets("Exported data").Copy
wb1.Activate

HTH

Charles Chickering

wrote:
I'm copying one sheet to an empty workbook with this code:

Sheets("Exported data").Copy

This opens a new workbook beautifully. After this is done I want to
return to the original workbook and hide the sheet "Exported data". How
can this be done?

Regards,

S


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 644
Default How to activate original workbook?

Oops forgot the last half...
Dim wb1 as Workbook
Set wb1 = ActiveWorkbook
Sheets("Exported data").Copy
wb1.Activate
Sheets("Exported data").Visible = 0
'You can also set this to -2 to keep users from seeing this sheet in
the unhide dialog

Charles

Die_Another_Day wrote:
Dim wb1 as Workbook
Set wb1 = ActiveWorkbook
Sheets("Exported data").Copy
wb1.Activate

HTH

Charles Chickering

wrote:
I'm copying one sheet to an empty workbook with this code:

Sheets("Exported data").Copy

This opens a new workbook beautifully. After this is done I want to
return to the original workbook and hide the sheet "Exported data". How
can this be done?

Regards,

S


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35
Default How to activate original workbook?

Thanks a lot!

// S

Die_Another_Day skrev:

Oops forgot the last half...
Dim wb1 as Workbook
Set wb1 = ActiveWorkbook
Sheets("Exported data").Copy
wb1.Activate
Sheets("Exported data").Visible = 0
'You can also set this to -2 to keep users from seeing this sheet in
the unhide dialog

Charles

Die_Another_Day wrote:
Dim wb1 as Workbook
Set wb1 = ActiveWorkbook
Sheets("Exported data").Copy
wb1.Activate

HTH

Charles Chickering

wrote:
I'm copying one sheet to an empty workbook with this code:

Sheets("Exported data").Copy

This opens a new workbook beautifully. After this is done I want to
return to the original workbook and hide the sheet "Exported data". How
can this be done?

Regards,

S


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
Return to Original Workbook ajvasel Excel Programming 12 August 10th 06 03:32 AM
loop through a column on a workbook copying data on each row to another workbook, then copy data back to the original workbook burl_rfc Excel Programming 1 April 1st 06 08:48 PM
Original Workbook maximus73 Excel Discussion (Misc queries) 0 March 22nd 06 09:41 PM
Workbook.Activate / Window.Activate problem Tim[_44_] Excel Programming 3 February 3rd 06 11:38 PM
Returning to original workbook Jim Cone Excel Programming 0 July 23rd 04 11:03 AM


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