ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   help need on VBA code (https://www.excelbanter.com/excel-programming/318521-help-need-vba-code.html)

Shane

help need on VBA code
 
Hi all,

I have the following data in columsn A and B. I would like to know how i can
about placing my curcer on column b and running code which will place first
number in column A against the name in B to achieve one number against each
unique name. Ive highlighted the desired results in column C so you can see
the pattern.

Your help is most appreciated.

a b c
Number name PrimaryNo
1 Black 1
2 Black 1
3 Black 1
4 Black 1
5 blue 5
6 red 6
7 yellow 7
8 Pink 8
9 Pink 8
10 Pink 8
11 Pink 8



Bob Phillips[_6_]

help need on VBA code
 
Shane,

You don't need VBA. Put this in B1 and copy down

=MATCH(A1,$A$1:$A$100,0)

--

HTH

RP
(remove nothere from the email address if mailing direct)


"Shane" wrote in message
...
Hi all,

I have the following data in columsn A and B. I would like to know how i

can
about placing my curcer on column b and running code which will place

first
number in column A against the name in B to achieve one number against

each
unique name. Ive highlighted the desired results in column C so you can

see
the pattern.

Your help is most appreciated.

a b c
Number name PrimaryNo
1 Black 1
2 Black 1
3 Black 1
4 Black 1
5 blue 5
6 red 6
7 yellow 7
8 Pink 8
9 Pink 8
10 Pink 8
11 Pink 8






All times are GMT +1. The time now is 01:58 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com