View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
MacroAlan[_3_] MacroAlan[_3_] is offline
external usenet poster
 
Posts: 2
Default Macro for changing tabs

First you need to count the number of sheets you have, then
Starting at the last, increment it first. Something like:

NumberSheets = Sheets.Count
Sheets.Add
For X = NumberSheets to 1 Step -1

Sheets(x).Select
Sheets(x).Name = "Week" & X
Next X

If you change Week1 to 2 before 2 is changed you will have conflict.

Alan

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!