Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Referencing a new worksheet

How do I refer to a new worksheets created by copying an existing sheet.

I have the following code:

worksheets("Test").copy after:=worksheets(worksheets.count)

This creates a new worksheet called "Test (2)", I now want to be able to
rename that newly created worksheet.

I thought worksheets(worksheets.count) would always be the last create
worksheet, but this does not seem to be the case.

Can someone please tell me how to reference a newly created worksheet.

Paul Smith


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 66
Default Referencing a new worksheet

did you try active.worksheet ?



CEsar





"Paul W Smith" wrote in message
...
How do I refer to a new worksheets created by copying an existing sheet.

I have the following code:

worksheets("Test").copy after:=worksheets(worksheets.count)

This creates a new worksheet called "Test (2)", I now want to be able to
rename that newly created worksheet.

I thought worksheets(worksheets.count) would always be the last create
worksheet, but this does not seem to be the case.

Can someone please tell me how to reference a newly created worksheet.

Paul Smith




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 66
Default Referencing a new worksheet

well. in this case that will be the active sheet. then you can do
activesheet.name = "NewSheet"



"Paul W Smith" wrote in message
...
How do I refer to a new worksheets created by copying an existing sheet.

I have the following code:

worksheets("Test").copy after:=worksheets(worksheets.count)

This creates a new worksheet called "Test (2)", I now want to be able to
rename that newly created worksheet.

I thought worksheets(worksheets.count) would always be the last create
worksheet, but this does not seem to be the case.

Can someone please tell me how to reference a newly created worksheet.

Paul Smith




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
Referencing another worksheet Carena Excel Worksheet Functions 2 August 27th 08 12:26 AM
referencing the name of a worksheet Simon P California Excel Discussion (Misc queries) 5 October 15th 07 02:47 PM
Referencing a Worksheet newguy Excel Discussion (Misc queries) 3 December 12th 06 07:31 PM
CountIF() in Worksheet B while referencing cells in Worksheet A jfj3rd Excel Worksheet Functions 3 April 14th 06 11:24 PM
CountIF() in Worksheet B while referencing cells in Worksheet A jfj3rd Excel Worksheet Functions 3 April 14th 06 07:36 PM


All times are GMT +1. The time now is 11:16 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"