Dear all,
I am new to this forum, which helped me many many times in the past - so thanks to all contributors for their amazing job.
Nevertheless, I couldn't find a solution to an issue that seems easy at first sight :D.
I am trying to create a macro which would allow me to put sequential numbering in an excel sheet I am building. The idea of this macro is to put the "Level 1" number on column A (e.g., 1, 2, 3,...) and the "Level 2" in column B (e.g., 1.1., 1.2., 2.1., 2.2., 2.3., etc.).
By googling and researching I could find a way of dealing with such issue using names, whereas names are defined as follow (supposing the Level1 number is put in cell A13 and Level2 in cell B18):
Level1 = IF(COUNTA(Sheet1!$A$1:$A12)=0,0,INDEX(Sheet1!$A$1:$A12,MATCH(ROW(Sheet1!$A12), Sheet1!$A$1:$A12,TRUE)))+1
Level2 = Book1!Level1-1&"."&MAX(1,COUNTA(INDEX(Sheet1!$B$1:$B17,MATCH(Book1!Level1-1,Sheet1!$A$1:$A17,FALSE)):Sheet1!$B17))
The problems I am encountering are the following:
1. If I create a new sheet from scratch, I'd have to insert the names defined above every time
2. If I duplicate I sheet in a given file, then the names are duplicated as well (i.e., I will have names for Sheet1, Sheet2, etc.)
As such, I am trying to build up a macro allowing me to create such numbering without creating duplicate names and allowing me to use it in other workbooks independently.
I hope having put all necessary inputs and that someone could help me figure out how to solve such issue.
Thank you all in advance.
Kubo
Bookmarks