+ Reply to Thread
Results 1 to 6 of 6

Loop that finds a value based on user input

  1. #1
    Registered User
    Join Date
    02-02-2017
    Location
    Raleigh, NC
    MS-Off Ver
    2016
    Posts
    2

    Question Loop that finds a value based on user input

    Hi everyone,

    I am a VBA beginner and I am facing an issue right now. I need to write a code that finds a value within a table based on the row and column where it is located.

    PROBLEM.JPG

    Upper left corner of table is located in A1

    I am supposed to input a number from 1 to 10 (leftmost column), then a letter from A to G, and based on those inputs I have to display the number. So for instance, if I input 1 and A, the number displayed should be 6.

    How do I do this? It's supposed to be done with loops, and it's doable without using array constructions.

    Thank you in advance.
    Last edited by svolont; 02-02-2017 at 03:46 PM.

  2. #2
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    4,492

    Re: Loop that finds a value based on user input

    How to know where your table is ???
    - Battle without fear gives no glory - Just try

  3. #3
    Registered User
    Join Date
    02-02-2017
    Location
    Raleigh, NC
    MS-Off Ver
    2016
    Posts
    2

    Re: Loop that finds a value based on user input

    Upper left corner is located in A1

  4. #4
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    4,492

    Re: Loop that finds a value based on user input

    Try
    Please Login or Register  to view this content.
    Last edited by PCI; 02-02-2017 at 04:14 PM. Reason: Code changed

  5. #5
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Loop that finds a value based on user input

    Does this help any?

    Please Login or Register  to view this content.

  6. #6
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    4,492

    Re: Loop that finds a value based on user input

    Note: in next code it assumes that row 1 with letters and column 1 with numbers are part of the table
    Please Login or Register  to view this content.

+ 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: 0
    Last Post: 08-11-2016, 09:28 PM
  2. User Input For Loop Issues
    By Jietoh in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 12-23-2015, 09:40 AM
  3. How to Loop through Column and Modify Values Based on User Input
    By bryanmarks in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-26-2015, 11:38 AM
  4. Data Input Form with number of line items based on user input
    By j_gideon in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-25-2013, 02:54 PM
  5. Replies: 4
    Last Post: 01-15-2013, 03:56 PM
  6. Using text box input to lookup number and replace based on user input into new column
    By harl3y412 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-28-2011, 03:15 PM
  7. Do while Loop that is conditional based upon user input?
    By gplush in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-21-2009, 02:01 AM

Tags for this Thread

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