Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Referencing another worksheet | Excel Worksheet Functions | |||
referencing the name of a worksheet | Excel Discussion (Misc queries) | |||
Referencing a Worksheet | Excel Discussion (Misc queries) | |||
CountIF() in Worksheet B while referencing cells in Worksheet A | Excel Worksheet Functions | |||
CountIF() in Worksheet B while referencing cells in Worksheet A | Excel Worksheet Functions |