Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default 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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 735
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default 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
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
2007 Worksheet, Hidden Columns, .CSV Format Saves Hidden Column Da Tammy Excel Discussion (Misc queries) 3 April 2nd 09 11:40 PM
Copy and Paste with hidden columns remaining hidden Pendelfin Excel Discussion (Misc queries) 2 February 26th 09 11:35 AM
Copy Worksheet and Exclude Hidden fields Charles Gonzalez Excel Worksheet Functions 3 August 12th 08 12:31 AM
How do I copy a worksheet so that hidden columns remain secret? Vanessa Long Excel Discussion (Misc queries) 1 July 9th 07 01:42 PM
How do I NOT copy hidden rows to a new worksheet? Steve Excel Discussion (Misc queries) 3 March 3rd 06 05:47 PM


All times are GMT +1. The time now is 07:46 AM.

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"