ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Find first occurence of specific data in a column. (https://www.excelbanter.com/excel-programming/329987-find-first-occurence-specific-data-column.html)

Ben

Find first occurence of specific data in a column.
 
I would like to be able to run a macro that will find the first occurence in
a column of specified data. There are multiple rows with 1.2005 then more
multiple rows with 2.2005 and so on. I need to locate the first instance of
1.2005, 2.2005 etc and return the value in a cell in the same row but an
adjacent column.
Many thanks.

Tom Ogilvy

Find first occurence of specific data in a column.
 
Since your data is sorted then:
=vlookup(1.2005,A1:B2000,2,False)

in VBA

res = application.Vlookup(1.2005,Range("A1:B2000"),2,Fal se)

--
Regards,
Tom Ogilvy


"Ben" wrote in message
...
I would like to be able to run a macro that will find the first occurence

in
a column of specified data. There are multiple rows with 1.2005 then more
multiple rows with 2.2005 and so on. I need to locate the first instance

of
1.2005, 2.2005 etc and return the value in a cell in the same row but an
adjacent column.
Many thanks.




Damien McBain[_2_]

Find first occurence of specific data in a column.
 
"Ben" wrote in message
...
I would like to be able to run a macro that will find the first occurence
in
a column of specified data. There are multiple rows with 1.2005 then more
multiple rows with 2.2005 and so on. I need to locate the first instance
of
1.2005, 2.2005 etc and return the value in a cell in the same row but an
adjacent column.


just whack:

=if(a2=a1,"It changes here!","")

in cell b2 then copy it down



Ben

Find first occurence of specific data in a column.
 
Problem solved!
Many thanks.

"Tom Ogilvy" wrote:

Since your data is sorted then:
=vlookup(1.2005,A1:B2000,2,False)

in VBA

res = application.Vlookup(1.2005,Range("A1:B2000"),2,Fal se)

--
Regards,
Tom Ogilvy


"Ben" wrote in message
...
I would like to be able to run a macro that will find the first occurence

in
a column of specified data. There are multiple rows with 1.2005 then more
multiple rows with 2.2005 and so on. I need to locate the first instance

of
1.2005, 2.2005 etc and return the value in a cell in the same row but an
adjacent column.
Many thanks.






All times are GMT +1. The time now is 03:21 AM.

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