+ Reply to Thread
Results 1 to 3 of 3

Don't even know how to describe this!

  1. #1
    Registered User
    Join Date
    02-05-2007
    Posts
    2

    Don't even know how to describe this!

    Here's what I am basically trying to do:

    There is a list of data like this:

    Ticker Date
    goog 1/2/07
    goog 1/3/07
    goog 1/4/07
    goog 1/5/07
    goog 1/8/07
    goog 1/9/07
    ibm 1/2/07
    ibm 1/3/07
    ibm 1/4/07
    ibm 1/5/07

    Basically I need is VBA code to do the following:

    Identify the first instance of goog, give me the the row#
    Identify the last instance of goog, give me the row#

    Identify the first instance of ibm, give me the the row#
    Identify the last instance of ibm, give me the row#

    I guess what is getting complex for me is the following:
    There will not always be two unique stocks, sometimes it could be 2, sometimes it could be 10, or whatever, so do I need to build an array of some sort to get all the unique values in column A (ticker column) and then do some search for first and last instances.

    Also, from the example, there won't necessarily be the same number of instances of each stock either.

    I hope this makes sense and any help would be much appreciated.

    ~Gooser
    Last edited by gooser60; 02-05-2007 at 04:57 PM.

  2. #2
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    Hi,

    Here's a non VBA way

    =IF(A2<>A3,ROW(),IF(SUMPRODUCT(--($A$2:A2=A2))=1,ROW(),""))

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  3. #3
    Registered User
    Join Date
    02-05-2007
    Posts
    2
    VBA Noob,

    Thanks for the help, I will see I can get this into some functioning VBA code.

+ 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