ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   rename a worksheet adding a sequential number at the end (https://www.excelbanter.com/excel-programming/419757-rename-worksheet-adding-sequential-number-end.html)

BeSmart

rename a worksheet adding a sequential number at the end
 
Hi All

I need to create a code and Im not sure if its even possible €“ your help
would be greatly appreciated:

Excel 2003
Relevant part of current code:

ActiveSheet.Name = "MBA" & " " & Sheets("Sheet2").Range("A2").Value

I need to:

- add a check into my macro to see if the new worksheet name "MBA Wk1"
already exists

- if TRUE, then I need to check if there are any values on
Sheets("Sheet2").Range("C131:C150"),

- if also TRUE then I need to create the new worksheet with a sequential
number added to the end of the new worksheet name e.g:

MBA Wk1 becomes MBA Wk1 (2),

otherwise call the next macro €œweek2()€

The macro may be run a few times as data is revised - therefore it needs to
create update the sequential number e.g. MBA Wk1 (3) next time etc.

--
Thank for your help
BeSmart


All times are GMT +1. The time now is 12:18 AM.

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