+ Reply to Thread
Results 1 to 9 of 9

vba to display lookup results in a msg box

  1. #1
    Forum Contributor
    Join Date
    12-30-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    143

    vba to display lookup results in a msg box

    HI

    I need a Vba that does the following.

    In a sheet called "customer info" i have two columns customer number, and the customers phone number.

    in another sheet i have the customer number, and other info for that customer in a pivot table format (which doesn't matter for this question)

    i would like that if i select a customer number and hit a command button it should displays that select customer number phone number in a MSG box

    Like vlookup results in a MSG box

    Thanks

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: vba to display lookup results in a msg box

    Post your sample workbook so that we can give exact code


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: vba to display lookup results in a msg box

    Hi BORUCH

    Something like this...
    Attached Files Attached Files
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

  4. #4
    Forum Contributor
    Join Date
    12-30-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    143

    Re: vba to display lookup results in a msg box

    Quote Originally Posted by sintek View Post
    Hi BORUCH

    Something like this...
    YES SOMETHING LIKE THIS

    but i need a few thing changed

    # it should be selection not VLookup(Range("D2")

    #2 i would like to have the phone number in bold lettering (more customized like font etc.)

    #3 if possible it should close after 30 seconds

    maybe a user form is a better option

    thanks

  5. #5
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: vba to display lookup results in a msg box

    See Post no 2 from sixthsense

    This will enable us to give exact code and not make assumptions!

  6. #6
    Forum Contributor
    Join Date
    12-30-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    143

    Re: vba to display lookup results in a msg box

    Quote Originally Posted by sintek View Post
    See Post no 2 from sixthsense

    This will enable us to give exact code and not make assumptions!
    the sample workbook is a great example

  7. #7
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: vba to display lookup results in a msg box

    Play around with this...

    Edit...Displays for 10 seconds then closes....Edit font as per requirement
    Not sure what you mean by
    # it should be selection not VLookup(Range("D2")
    Attached Files Attached Files

  8. #8
    Forum Contributor
    Join Date
    12-30-2014
    Location
    USA
    MS-Off Ver
    2016
    Posts
    143

    Re: vba to display lookup results in a msg box

    i mean to say that whatever is selected should be used as the lookup value not cell d2

    also there should also be an option to close the user form before 10 seconds

    also if it cant find a match it should return value not found

  9. #9
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,239

    Re: vba to display lookup results in a msg box

    See attached...

    Code searches selected cell.
    In future with other posts, please be more specific with your requirements, so that we can write the exact code required and not waste time.
    Attached Files Attached Files
    Last edited by sintek; 10-11-2017 at 05:29 AM.

+ 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: 2
    Last Post: 08-16-2016, 08:30 AM
  2. [SOLVED] How do I only display formula results ONLY if there's results to display, and not just N/A
    By erikaberglund in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 10-23-2015, 02:38 PM
  3. VBA Code to lookup values in a cell and display results in a pop-up box
    By VBAismockingme in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-08-2013, 12:04 PM
  4. [SOLVED] Display search results inluding results that match patrially
    By RichTea88 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-06-2013, 08:52 AM
  5. Using Lookup or match to display a list of results from a range of cells
    By jshaw82 in forum Excel Formulas & Functions
    Replies: 9
    Last Post: 05-14-2013, 05:55 PM
  6. [SOLVED] Unable to display mail merge results using Preview Results function
    By trandle in forum Word Formatting & General
    Replies: 1
    Last Post: 05-30-2012, 12:29 AM
  7. 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