View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Pieman
 
Posts: n/a
Default Worksheet Names as a Date

OK, is this correct...

Public Sub Worksheet_Name()
ThisWorkbook.Worksheets("Sheet2").Name = Year(Date)
ThisWorkbook.Worksheets("Sheet3").Name = Year(Date) - 1
End Sub


"Ardus Petus" wrote:

Where did you plce the code?
It should be within a Sub, in a Module.

NOT in the Worksheet's Code

HTH
--
AP

"Pieman" a écrit dans le message de
...
Hi

I tried the code you suggested in the VB editor for each sheet and nothing
changed. Could this be because there is already some extra code for this
sheet as follows: