+ Reply to Thread
Results 1 to 4 of 4

Find a Max Date based on a corresponding value VBA

  1. #1
    Registered User
    Join Date
    05-25-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    11

    Find a Max Date based on a corresponding value VBA

    crosslinked:
    http://www.ozgrid.com/forum/showthread.php?t=178918
    http://www.excelforum.com/excel-prog...value-vba.html
    http://www.mrexcel.com/forum/newthre...do=newthread&f

    Hello everyone,
    I'm in the process of trying to figure out how to find the max date of a value in column A. From there I need to link up the price associated with that date. The information I'm working with is structured like this in this image:

    MaxDate.PNG
    What I want to do using VBA, is to look at the values in column A and for each of them, find the max date or most recent date. Once that is determined, on a new sheet, I want to write the value found in column A in sheet2/ColumnA and the date in column B, and the price in column C. In a nutshell, I'm looking for an effective date for pricing. The example on the bottom is basically what I'd like to extract with code onto another sheet.

    I've tried doing it with a pivot table with no success, and I tried a little bit with the scripting.dictionary, but that's kind of confusing to me. If anyone could help with this, it would be much appreciated.

    thanks,
    jimalya
    Last edited by jimalya; 05-25-2013 at 05:55 PM.

  2. #2
    Valued Forum Contributor marreco's Avatar
    Join Date
    07-02-2011
    Location
    Brazil
    MS-Off Ver
    Excel 2010
    Posts
    1,862

    Re: Find a Max Date based on a corresponding value VBA

    hi
    try
    =MAX(IF(G2=$A$2:$A$11,$B$2:$B$11,""))

    Press -> Ctrl + Alt + Enter
    "No xadrez nem sempre a menor dist?ncia entre dois pontos ? uma linha reta" G. Kasparov.

    If your problem is solved, please say so clearly, and mark your thread as Solved: Click the Edit button on your first post in the thread, Click Go Advanced, select b from the Prefix dropdown, then click Save Changes. If more than two days have elapsed, the Edit button will not appear -- ask a moderator to mark it.

  3. #3
    Registered User
    Join Date
    05-25-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Find a Max Date based on a corresponding value VBA

    Hey marreco, I replied a minute ago, but it's not showing up. If it doesn't show up, thanks for your quick reply. I tried your solution and all I got were zeroes. I did remember to CTRL+SHIFT+ENTER. CTRL+ALT+ENTER didn't do anything.

    Although I appreciate your reply, I was actually looking for a VBA solution that would write the found values to another worksheet systematically. I have another function that will be reading from that list. Would you happen to know how to help me with that?

    thanks
    Jimalya

  4. #4
    Registered User
    Join Date
    05-25-2013
    Location
    United States
    MS-Off Ver
    Excel 2010
    Posts
    11

    Re: Find a Max Date based on a corresponding value VBA


+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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