+ Reply to Thread
Results 1 to 4 of 4

[SOLVED] Enter column A and B values, return column C value?

  1. #1
    Registered User
    Join Date
    02-26-2010
    Location
    UK
    MS-Off Ver
    Excel 2013
    Posts
    7

    [SOLVED] Enter column A and B values, return column C value?

    Hi,

    Excel newbie here.

    I have a spreadsheet that lists:
    Place A, Place B, Distance
    in columns A, B and C.

    Is there a simple way, with VBA, to allow to:
    -press a button which prompts the user to enter Place A and Place B; and
    -returns the distance (column C) if there is a matching row (or an error message if not)

    Thanks in advance!

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Enter column A and B values, return column C value?

    Sure. Or you can use an INDEX/MATCH/MATCH to get map distances from a table.

    Here's some sample sheets showing exactly what you're looking to do.
    Jerry Beaucaire's INDEX/MATCH Examples

    Open the second sheet, the IndexMatch-Simple.xls and you'll see two ways to use a table format with an INDEX/MATCH/MATCH formula.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    02-26-2010
    Location
    UK
    MS-Off Ver
    Excel 2013
    Posts
    7

    Re: Enter column A and B values, return column C value?

    Brilliant, that's exactly what I'm looking for, cheers.

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Enter column A and B values, return column C value?

    If that takes care of your need, use the Thread Tools menu to mark the this thread as [SOLVED].

    (Also, use the blue "scales" icon in our posts to leave Reputation Feedback, it is appreciated. It is found across from the "time" in each of our posts.)

+ 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