View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default Rename a worksheet that includes a cell refeerence

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.