Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have the following code included in a macro:
Sheets("Week XX").Copy After:=Sheets(ActiveWorkbook.Sheets.Count) Application.Goto Reference:="'Week XX (2)'!R3C3" What I would like to do is rename the copied worksheet "'Week XX (2)!'" to: 'Week 19' where the number '19' is obtained from cell C3 of the worksheet. Each time I copy the worksheet cell C3 already has a new unique number displayed so there will be no chance of a worksheet ever being duplicated. Thanks for your assistance with this. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Maybe
Sub stantial() Sheets("Week XX").Copy After:=Sheets(ActiveWorkbook.Sheets.Count) ActiveSheet.Name = "Week XX (2)" & Sheets("Week XX").Range("C3").Value End Sub Mike "DBavirsha" wrote: I have the following code included in a macro: Sheets("Week XX").Copy After:=Sheets(ActiveWorkbook.Sheets.Count) Application.Goto Reference:="'Week XX (2)'!R3C3" What I would like to do is rename the copied worksheet "'Week XX (2)!'" to: 'Week 19' where the number '19' is obtained from cell C3 of the worksheet. Each time I copy the worksheet cell C3 already has a new unique number displayed so there will be no chance of a worksheet ever being duplicated. Thanks for your assistance with this. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I see how the value from cell C3 is added to the worksheet, however; when I
run the macro the new worksheet is renamed 'Week XX (2) "C3"' and what I am really looking for is the sheet to be renamed 'Week "C3"'. I want to replace the 'XX (2)' in the new worksheet with the value of cell C3. The value in C3 is a whold number such as 19, 20, 25, etc., so that when the sheet is copied and renamed it is copied and renamed from 'Week XX' to 'Week XX (2)' to 'Week 19' where '19' happens to be the contents of cell C3. Thanks, Dave "Mike H" wrote: Maybe Sub stantial() Sheets("Week XX").Copy After:=Sheets(ActiveWorkbook.Sheets.Count) ActiveSheet.Name = "Week XX (2)" & Sheets("Week XX").Range("C3").Value End Sub Mike "DBavirsha" wrote: I have the following code included in a macro: Sheets("Week XX").Copy After:=Sheets(ActiveWorkbook.Sheets.Count) Application.Goto Reference:="'Week XX (2)'!R3C3" What I would like to do is rename the copied worksheet "'Week XX (2)!'" to: 'Week 19' where the number '19' is obtained from cell C3 of the worksheet. Each time I copy the worksheet cell C3 already has a new unique number displayed so there will be no chance of a worksheet ever being duplicated. Thanks for your assistance with this. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Rename Worksheet From Cell Data | Excel Worksheet Functions | |||
Rename Worksheet Tabs per Cell Content | Excel Programming | |||
Rename a Worksheet on Input of Value in Cell | Excel Worksheet Functions | |||
VBA to Rename Excel Worksheet Value of Cell. | Excel Programming | |||
how do i rename worksheet to equal cell name | Excel Worksheet Functions |