+ Reply to Thread
Results 1 to 2 of 2

VBA Code to lookup values in a cell and display results in a pop-up box

  1. #1
    Registered User
    Join Date
    10-08-2013
    Location
    UK
    MS-Off Ver
    Excel 2010
    Posts
    1

    Question VBA Code to lookup values in a cell and display results in a pop-up box

    Hi hope someone can help with my VBA headache!

    I have an Excel workbook, see attached for example, in which 'Sheet 1' is an example of the first sheet that contains a list and against each entry a string of numbers each one of which relates to an item in a list detailed in 'Sheet 2'. The number in the string can be variable.

    Sheet 3 is a 'mock up' of the ideal results, if you were to click or hover over one of the cells containing the strings of numbers. The location of the pop-up containing the selected data would actually appear on the screen might be a bit random.

    So the code would need to activate when the mouse hovers or clicks on a cell, then strip out the individual items in that cell, look each one up from a master list then display in a pop up box the resulting list which would need to be sized appropriately to display the data.

    This is part of a bigger spreadsheet so cannot be done in another tool, can anyone advise if this is possible and give me any pointers please?

    Any help very much appreciated.

    Cheers
    Neil
    Attached Files Attached Files

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,588

    Re: VBA Code to lookup values in a cell and display results in a pop-up box

    Yes, I should think it's possible. You'd use a Selection Change event to monitor the "cells of interest". If one is clicked on, you first check if there is anything in it. If there's not, exit. If there is, use Split (space delimited) to create an array of vulnerabilities. Then loop through the array looking up each value.

    You could build up a string concatenating each of the elements using vbCRLF to create line breaks for each vulnerability ... and then you could drop the string somewhere (that's the "and a miracle happens" bit)

    In theory, relatively straightforward

    Regard, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 3
    Last Post: 06-19-2013, 03:40 AM
  2. [SOLVED] How to count multiple cell values & do a validation & display results on a different cell
    By adriandefry in forum Excel Formulas & Functions
    Replies: 10
    Last Post: 08-03-2012, 09:12 AM
  3. [SOLVED] lookup multiple values of a single cell and return sum of results
    By Zeppelin17 in forum Excel General
    Replies: 7
    Last Post: 08-10-2011, 07:09 PM
  4. Code does not display values in the cell
    By ravichander in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-08-2009, 08:51 PM
  5. Lookup results from anouther worksheet and display specific ones
    By kanuvas in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-27-2008, 12:46 PM

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