assigning number ID's to each unique value on a list


Board Regular
Jun 15, 2010
I have no idea where to start with this. I have 2 list of names one for managers and one for the employees under them. I need to automatically assign a ID or number value to each name "this is being ran within another macro" So that i can do a vlookup on column b of the managers list and return the assign numbers in a list of employees with duplicates

does anyone know how i can automatically assign a number value to the first list. the first cell of data is always blank so if there was a way to tell the macro to start assighing at the first non blank adjacent cell, i might be able to just manually add a 1 and copy down


List of managers
Bob 1
Peter 2
Angela 3
Frank 4
Justin 5

Jennifer Bob
Brian Peter
David Bob
Natasha Frank
Jeff Angela
Maria Angela
Kevin Justin
Antoinette Frank

Some videos you may like

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.


Board Regular
Jun 15, 2010
I Do have another question does it make more sence to do a v look up for this than an If statement ?


If the manager name in column I3 matches any from the range P3: P7 return the value from Q,
it seems to work better as a vlookup, but i wanted to see if i could do it as a IF statement

Subscribe on YouTube

Watch MrExcel Video

Forum statistics

Latest member

This Week's Hot Topics

  • Turn fraction around
    Hello I need to turn a fraction around, for example I have 1/3 but I need to present as 3/1
  • TIme Clock record reformatting to ???
    Hello All, I'd like some help formatting this (Tbl-A)(Loaded via Power Query) [ATTACH type="full" width="511px" alt="PQdata.png"]22252[/ATTACH]...
  • TextBox Match
    hi, I am having a few issues with my code below, what I need it to do is when they enter a value in textbox8 (QTY) either 1,2 or 3 the 3 textboxes...
  • Using Large function based on Multiple Criteria
    Hello, I can't seem to get a Large formula to work based on two criteria's. I can easily get a oldest value based one value, but I'm struggling...
  • Can you check my code please
    Hi, Im going round in circles with a Compil Error End With Without With Here is the code [CODE=rich] Private Sub...
  • Combining 2 pivot tables into 1 chart
    Hello everyone, My question sounds simple but I do not know the answer. I have 2 pivot tables and 2 charts that go with this. However I want to...