Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy hidden worksheet
Hi - trying to modify the below code to copy (ref: Tom Ogilvy) a
hidden worksheet called TEMPLATE but rather than copy to front of the worksheet list trying to enter it 1 sheet in (i.e. after an index page). I have tried changing the Copy Before to Copy After. This places the copied sheet in teh right location but it is copied as a hidden sheet. Sub AddNewSheet() Worksheets("TEMPLATE").Copy Befo=Worksheets(1) Worksheets(1).Visible = xlSheetVisible End Sub Chen anyone help please? Thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy hidden worksheet
The worksheet copy will not be index 1 if you are placing it after
worksheet(1). Change code to the following. Sub AddNewSheet() Worksheets("TEMPLATE").Copy After:=Worksheets(1) Worksheets(2).Visible = xlSheetVisible End Sub -- Regards, Nigel "Porky79" wrote in message ... Hi - trying to modify the below code to copy (ref: Tom Ogilvy) a hidden worksheet called TEMPLATE but rather than copy to front of the worksheet list trying to enter it 1 sheet in (i.e. after an index page). I have tried changing the Copy Before to Copy After. This places the copied sheet in teh right location but it is copied as a hidden sheet. Sub AddNewSheet() Worksheets("TEMPLATE").Copy Befo=Worksheets(1) Worksheets(1).Visible = xlSheetVisible End Sub Chen anyone help please? Thanks |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy hidden worksheet
Ah I see - Almost there. Copies and creates visable worksheet, but for
some reason then selects the next worksheet as the 'current' or 'active' worksheet. I want the copied sheet to be the active sheet to prevent any data being incorrectly entered. Thanks so much for your time Paul |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy hidden worksheet
Sub AddNewSheet()
Worksheets("TEMPLATE").Copy After:=Worksheets(1) Worksheets(2).Visible = xlSheetVisible Worksheets(2).Activate End Sub -- Regards, Nigel "Porky79" wrote in message ... Ah I see - Almost there. Copies and creates visable worksheet, but for some reason then selects the next worksheet as the 'current' or 'active' worksheet. I want the copied sheet to be the active sheet to prevent any data being incorrectly entered. Thanks so much for your time Paul |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Copy hidden worksheet
Make it visible and then select/activate it:
Sub AddNewSheet() Worksheets("TEMPLATE").Copy After:=Worksheets(1) Worksheets(2).Visible = xlSheetVisible worksheets(2).select '<-- added End Sub Porky79 wrote: Ah I see - Almost there. Copies and creates visable worksheet, but for some reason then selects the next worksheet as the 'current' or 'active' worksheet. I want the copied sheet to be the active sheet to prevent any data being incorrectly entered. Thanks so much for your time Paul -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
2007 Worksheet, Hidden Columns, .CSV Format Saves Hidden Column Da | Excel Discussion (Misc queries) | |||
Copy and Paste with hidden columns remaining hidden | Excel Discussion (Misc queries) | |||
Copy Worksheet and Exclude Hidden fields | Excel Worksheet Functions | |||
How do I copy a worksheet so that hidden columns remain secret? | Excel Discussion (Misc queries) | |||
How do I NOT copy hidden rows to a new worksheet? | Excel Discussion (Misc queries) |