Hello i got a issue with converting groups in a dataset into numbers.. or maybe its called assign a group id.
So if example: (i have group name but not group ID)
I understand that you can make a case statement for each groupname and assign a number that way but if i want to make a vba code more dynamic (e.g put a new group input, will produce not wished results..) Im looking for a subrutine
So my question is if there is a way to make so kind of count of unique names in the group. In the example, there is 5 unique groups and then simply the group order is from the starting row and down.
But the number order doesnt matter just need convert same unique string variables uniqiue numbers.
Been searching for a while but no answer
I attach a excel file with same example but all variables exept group id is on input sheet and group id is on output sheet.
here is the excel
http://dl.dropbox.com/u/8387406/Book4.xlsx
Best regards
Mike
So if example: (i have group name but not group ID)
Code:
Name Group Value GroupID
Flower 1 FlowerGroupX 400 1
Flower 2 FlowerGroupB 200 2
Flower 3 FlowerGroupA 500 3
Flower 4 FlowerGroupX 200 1
Flower 5 FlowerGroupB 300 2
Flower 6 FlowerGroupY 500 4
Flower 7 FlowerGroupC 600 5
Flower 8 FlowerGroupX 100 1
Flower 9 FlowerGroupA 400 3
Flower 10 FlowerGroupY 200 4
I understand that you can make a case statement for each groupname and assign a number that way but if i want to make a vba code more dynamic (e.g put a new group input, will produce not wished results..) Im looking for a subrutine
So my question is if there is a way to make so kind of count of unique names in the group. In the example, there is 5 unique groups and then simply the group order is from the starting row and down.
But the number order doesnt matter just need convert same unique string variables uniqiue numbers.
Been searching for a while but no answer
I attach a excel file with same example but all variables exept group id is on input sheet and group id is on output sheet.
here is the excel
http://dl.dropbox.com/u/8387406/Book4.xlsx
Best regards
Mike
Last edited: