![]() |
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 |
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 |
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 |
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 |
All times are GMT +1. The time now is 06:57 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com