Activate new workbook with unknown name

R

rt10516

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!
 
R

Rowan

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
 
B

Bob Phillips

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)
 
R

rt10516

Thank you very much. This worked perfectly

Rowan said:
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
 
Top