+ Reply to Thread
Results 1 to 4 of 4

Find first occurence of specific data in a column.

  1. #1
    Ben
    Guest

    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. #2
    Tom Ogilvy
    Guest

    Re: 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,False)

    --
    Regards,
    Tom Ogilvy


    "Ben" <Ben@discussions.microsoft.com> wrote in message
    news:D66AF96B-514C-44EA-A017-7B5DF8811FFC@microsoft.com...
    > 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. #3
    Damien McBain
    Guest

    Re: Find first occurence of specific data in a column.

    "Ben" <Ben@discussions.microsoft.com> wrote in message
    news:D66AF96B-514C-44EA-A017-7B5DF8811FFC@microsoft.com...
    >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. #4
    Ben
    Guest

    Re: 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,False)
    >
    > --
    > Regards,
    > Tom Ogilvy
    >
    >
    > "Ben" <Ben@discussions.microsoft.com> wrote in message
    > news:D66AF96B-514C-44EA-A017-7B5DF8811FFC@microsoft.com...
    > > 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1