ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Macro for changing tabs (https://www.excelbanter.com/excel-programming/291191-re-macro-changing-tabs.html)

MacroAlan[_3_]

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!


All times are GMT +1. The time now is 03:47 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com