Thread: Macro
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Stefi Stefi is offline
external usenet poster
 
Posts: 2,646
Default Macro

Sheets("Template (2)").Name = Format(Worksheets.Count - 1, "00")

Regards,
Stefi


zephyr ezt *rta:

I have a command button that runs a macro. The macro copies a worksheet
template and renumbers it.

The problem is that I would like the worksheets to be numbered in sequence
i.e. 01, 02, 03 etc. The line below is an extract from the macro.

Sheets("Template (2)").Name "1"

Ca you please advise how to change this line so that each time the command
button is pressed the next number is allocated in sequence.

Many thanks for your assistance.