Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
rt10516
 
Posts: n/a
Default Activate new workbook with unknown name

Hi,

I have a macro that copies a worksheet from an existing workbook and moves
it to a new workbook (book 1, book 2, etc). I then go back to the original
workbook to hide the copied sheet. When all this is done I want the user to
be looking at the new workbook (book 1, book 2, etc).

Please provide some code to add to my copy macro.

Thank you very much....you guys/gals are great!

  #2   Report Post  
Rowan
 
Posts: n/a
Default

You don't have to return to the original workbook to hide the sheet. If the
macro is in the original workbook then simply:

Sheets(1).Copy
ThisWorkbook.Sheets(1).Visible = False

Hope this helps
Rowan

"rt10516" wrote:

Hi,

I have a macro that copies a worksheet from an existing workbook and moves
it to a new workbook (book 1, book 2, etc). I then go back to the original
workbook to hide the copied sheet. When all this is done I want the user to
be looking at the new workbook (book 1, book 2, etc).

Please provide some code to add to my copy macro.

Thank you very much....you guys/gals are great!

  #3   Report Post  
Bob Phillips
 
Posts: n/a
Default

If the code is not in this workbook

Set oThisWB = Activeworkbook
oThisWB.Worksheets("Sheet1").Copy
oThisWb.Worksheets("Sheet1").Visible = False

--

HTH

RP
(remove nothere from the email address if mailing direct)


"rt10516" wrote in message
...
Hi,

I have a macro that copies a worksheet from an existing workbook and moves
it to a new workbook (book 1, book 2, etc). I then go back to the original
workbook to hide the copied sheet. When all this is done I want the user

to
be looking at the new workbook (book 1, book 2, etc).

Please provide some code to add to my copy macro.

Thank you very much....you guys/gals are great!



  #4   Report Post  
rt10516
 
Posts: n/a
Default

Thank you very much. This worked perfectly

"Rowan" wrote:

You don't have to return to the original workbook to hide the sheet. If the
macro is in the original workbook then simply:

Sheets(1).Copy
ThisWorkbook.Sheets(1).Visible = False

Hope this helps
Rowan

"rt10516" wrote:

Hi,

I have a macro that copies a worksheet from an existing workbook and moves
it to a new workbook (book 1, book 2, etc). I then go back to the original
workbook to hide the copied sheet. When all this is done I want the user to
be looking at the new workbook (book 1, book 2, etc).

Please provide some code to add to my copy macro.

Thank you very much....you guys/gals are great!

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
HOW DO I SUM TWO CELLS FROM ONE WORKBOOK TO ANOTHER WORKBOOK? Bill O'Neal Excel Worksheet Functions 8 August 14th 09 11:36 PM
activate workbook w/unknown name Jim Cottrell Excel Discussion (Misc queries) 2 July 30th 05 12:31 AM
Activate a workbook from a selection GregR Excel Discussion (Misc queries) 1 April 7th 05 03:25 AM
Unprotect Workbook Kent Excel Discussion (Misc queries) 1 February 4th 05 01:07 AM
Stubborn toolbars in Excel 007 Excel Discussion (Misc queries) 9 December 11th 04 02:02 PM


All times are GMT +1. The time now is 11:26 PM.

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"