Hi There
I have created the following function which makes a copy of the worksheet "January" and then creates a new sheet.
It then enters the current month in cell C5 and current year in D5 of the new worksheet.
I then want it to rename the sheet to the current month using the value in cell C5. It all works up this stage but i am unable to rename the new worksheet.
The code stops at "ActiveSheet.Name = Range("C5").Value" highligting it yellow.
Would appreciate any help in putting this right.
Thanks
Charllie
I have created the following function which makes a copy of the worksheet "January" and then creates a new sheet.
It then enters the current month in cell C5 and current year in D5 of the new worksheet.
I then want it to rename the sheet to the current month using the value in cell C5. It all works up this stage but i am unable to rename the new worksheet.
The code stops at "ActiveSheet.Name = Range("C5").Value" highligting it yellow.
VBA Code:
Sheets("January").Copy After:=Sheets(Sheets.Count)
Sheets("January (2)").Select
With Range("C5")
.Value = Date
.NumberFormat = "mmmm"
End With
With Range("D5")
.Value = Date
.NumberFormat = "yyyy"
End With
ActiveSheet.Name = Range("C5").Value
Would appreciate any help in putting this right.
Thanks
Charllie