Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automating List Numbering in Excel

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I want to write VBA to number lists for me in Excel 97.

Column B contains a number of lists, separated by empty cells. Is it possible to automatically number these lists in Column A, starting from scratch after every blank cell?

The lists are of varying lengths.

Also, is it possible to do this with letters, (eg. a, b, c……)?
 
Assume your data list begins with row 2. Add the following equation to cell A2.

=IF(ISBLANK(B2),"",N(A1)+1)

Copy this formula down for all records.

Once you have created a counter, you can modify the equation to append A or B or C and so on.
 
Many thanks, thats exactly what I'm looking for. However you're giving me more credit than I deserve, how do you substitute numbers with letters?
 
I meant adding A or B or C after the lists have been numbered like so :
A1
A2
A3
A4

B1
B2
B3

To add A in front of the numbers :
+"A"&TEXT(B2,"000")

I don't know how to generate a lettered list.
 
I've managed to do it using =(CHAR(CODE(A1)+1)).

Thanks for your help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top