+ Reply to Thread
Results 1 to 2 of 2

vlookup with VBA

  1. #1
    Registered User
    Join Date
    01-12-2011
    Location
    Victoria, BC
    MS-Off Ver
    Excel 2003
    Posts
    42

    vlookup with VBA

    Hello,
    I would like to add the following ability to my spreadsheet. When there is a unit number populated in a cell, i would like to either double click on it, or hover the mouse over the unit number and be able to see information on the unit in a quick flash message. I do NOT want to populate the information in the spreasheet, just be able to refer to it and keep working.

    I have the information I want to display in another workbook and it would be simple enough to do a vlookup on the unit number and find unit type, unit year, unit status. However I want the information to come up in the form of a msgbox or Control tip text.

    Can anyone coach me on how to do a lookup in VBA?

    Thanks,
    Todd

  2. #2
    Valued Forum Contributor blane245's Avatar
    Join Date
    02-20-2009
    Location
    Melbourne, FL
    MS-Off Ver
    Excel 2010
    Posts
    649

    Re: vlookup with VBA

    here is some code that you might start with. You can't activate an event in Excel on a hover or a double click, but you can capture a selection change. This code opens a reference workbook the first time a specific sheet is actuivated, and then wherever the selection is changed in that sheet, it does the lookup on the reference table and display the message. Note that there are a number of assumptions abou the structure of the reference workbook and the location of the unit numbers.
    Put this code in VBA on the sheet object that you want the lookup to apply to. See if it gets close to what you want and we will go from there.
    Please Login or Register  to view this content.
    Bob
    Click my star if my answer helped you. Mark the thread as [SOLVED] if it has been.

+ 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