Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Old May 24th 05, 03:11 PM posted to microsoft.public.excel.programming
Ben Ben is offline
external usenet poster
 
First recorded activity by ExcelBanter: Jul 2006
Posts: 509
Default 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.

  #2   Report Post  
Old May 24th 05, 03:17 PM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: Jul 2006
Posts: 27,285
Default 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
news
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.



  #3   Report Post  
Old May 24th 05, 03:44 PM posted to microsoft.public.excel.programming
external usenet poster
 
First recorded activity by ExcelBanter: May 2005
Posts: 49
Default Find first occurence of specific data in a column.

"Ben" wrote in message
news
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


  #4   Report Post  
Old May 24th 05, 03:53 PM posted to microsoft.public.excel.programming
Ben Ben is offline
external usenet poster
 
First recorded activity by ExcelBanter: Jul 2006
Posts: 509
Default 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
news
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.






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Find a First Occurence in a Column Kevin Barrios[_2_] Excel Discussion (Misc queries) 5 January 6th 10 08:37 PM
find 2nd occurence Totti Excel Discussion (Misc queries) 6 November 18th 08 01:42 AM
Find first occurence in a list that's greater than a specific num stevep Excel Worksheet Functions 2 December 9th 05 08:41 PM
How can I find and sort specific data within a column? bpreas - ExcelForums.com Excel Discussion (Misc queries) 3 August 2nd 05 07:11 PM
Find column letter containing specific data markx Excel Worksheet Functions 4 March 17th 05 10:41 PM


All times are GMT +1. The time now is 06:35 AM.

Powered by vBulletin® Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright 2004-2017 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"

 

Copyright © 2017