+ Reply to Thread
Results 1 to 8 of 8

VBA LookUp date

  1. #1
    Registered User
    Join Date
    02-23-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    50

    VBA LookUp date

    Hi

    I have two worksheets. In "worksheet 1" I have a date formatted MMM-YY in column A and in column B I have a number.
    In the "worksheet 2" I have MMM-YY column headings.
    What I need is excel to lookup the date in worksheet 1 and return the number thats in column B under the corresponding MMM-YY column in worksheet 2. So, for examle;

    Worksheet 1
    Column A Column B
    OCT-12 5

    Worksheet 2
    SEPT-12 OCT-12 NOV-12
    5

    Thanks in advance
    Jen
    Last edited by tiger01; 02-08-2013 at 12:31 AM.

  2. #2
    Forum Contributor
    Join Date
    11-02-2011
    Location
    Rugby, England
    MS-Off Ver
    Office 365
    Posts
    869

    Re: VBA LookUp date

    Hi, how many dates will be entered into sheet2?
    Its often easier for you to post a sample workbook, with the expected result and some notes to explain.

    Otherwise anyone who tires to help has to guess what you want

  3. #3
    Forum Contributor
    Join Date
    11-02-2011
    Location
    Rugby, England
    MS-Off Ver
    Office 365
    Posts
    869

    Re: VBA LookUp date

    Hi again,

    Does the atatched help?
    sheet one has the raw data (column A = dates, Column B = number)
    Sheet 2 column A is where you manually type a date and then click the macro button.
    Attached Files Attached Files

  4. #4
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,669

    Re: VBA LookUp date

    Pl see the attached file with Formulas.You can drag to right.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    02-23-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    50

    Question Re: VBA LookUp date

    Excel Test.xlsx

    Hi Both
    Thanks for your replies.

    GP - sorry I couldnt get your macro to work as it was asking me to open as read only???
    KV - I couldnt get your formula to work in my spreadsheet.

    Ive attached a copy of what I am trying to do with notes. Appreciate your help.
    Cheers

    Jen

  6. #6
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: VBA LookUp date

    Jen

    Try this in H1 and copy across and down.
    Formula: copy to clipboard
    Please Login or Register  to view this content.
    If posting code please use code tags, see here.

  7. #7
    Registered User
    Join Date
    02-23-2011
    Location
    Singapore
    MS-Off Ver
    Excel 2007
    Posts
    50

    Re: VBA LookUp date

    Thanks Norie! Works Perfectly.
    Jen

  8. #8
    Forum Contributor
    Join Date
    11-02-2011
    Location
    Rugby, England
    MS-Off Ver
    Office 365
    Posts
    869

    Re: VBA LookUp date

    Hi, save mine to your desktop first :-)

+ 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