A Microsoft Excel forum. ExcelBanter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » ExcelBanter forum » Excel Newsgroups » Excel Programming
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Find first occurence of specific data in a column.



 
 
Thread Tools Display Modes
  #1  
Old May 24th 05, 03:11 PM posted to microsoft.public.excel.programming
Ben
external usenet poster
 
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.
Ads
  #2  
Old May 24th 05, 03:17 PM posted to microsoft.public.excel.programming
Tom Ogilvy
external usenet poster
 
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  
Old May 24th 05, 03:44 PM posted to microsoft.public.excel.programming
Damien McBain[_2_]
external usenet poster
 
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  
Old May 24th 05, 03:53 PM posted to microsoft.public.excel.programming
Ben
external usenet poster
 
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.

>
>
>

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

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:20 AM.


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