VBROB2B
06-15-2012, 10:59 PM
Please can someboby help me with a macro code in excel.
I have a column of various item names sorted alphabetically from top to bottom.
The item names are repeated under each other in various quantities ( eg some are only 1 , some are 2 , some are 3 etc ).
So reading the cells from top to bottom it may say orange then orange then apple then apple then apple then fig then fig then fig etc
I would love a code that would place in the cell opposite each item a number that reflects the number of times the item name is repeated.
eg for the first entry for "orange" it would have number "1" in cell opposite
For the second entry for "orange" it would have number "2" in cell opposite.
and for apples it would be 1 ,2 and 3 etc etc
I am a total novice in VBA but just love the way these macros work in excel.
Attached is file that shows what I am looking for
Thanks heaps to anyone of you who may be able to knock up a code for me
I have a column of various item names sorted alphabetically from top to bottom.
The item names are repeated under each other in various quantities ( eg some are only 1 , some are 2 , some are 3 etc ).
So reading the cells from top to bottom it may say orange then orange then apple then apple then apple then fig then fig then fig etc
I would love a code that would place in the cell opposite each item a number that reflects the number of times the item name is repeated.
eg for the first entry for "orange" it would have number "1" in cell opposite
For the second entry for "orange" it would have number "2" in cell opposite.
and for apples it would be 1 ,2 and 3 etc etc
I am a total novice in VBA but just love the way these macros work in excel.
Attached is file that shows what I am looking for
Thanks heaps to anyone of you who may be able to knock up a code for me