+ Reply to Thread
Results 1 to 6 of 6

Using variable from Input box to identify a cell

  1. #1
    Registered User
    Join Date
    08-09-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    Excel 2007
    Posts
    11

    Using variable from Input box to identify a cell

    I have a spreadsheet with various clients names, phone numbers, etc on Sheet 1. Each client has an ID number assigned in Column A and the data I need is in various cells in one row (eg: Name is in C9, ph. # is in D9, email is in H9). Sheet 2 has a form that gets printed out and given to the clients. I would like to have a macro or VB code to fill in the name, phone number etc. on the form based on which client is selected from Sheet 1. What I've got so far is an Input box where I input the client ID number. However, I've been unable to use this variable in the various cells on the form to fill in names, phone numbers, etc. What I was hoping to do is something like this:
    ='Sheet1!'vairable9 if I had entered 9 in my Input box.

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

    Re: Using variable from Input box to identify a cell

    In your case, I think it would be best to attach a file so we can better visualize what your beggining sheet looks like and what the form looks like.

    You might consider something like this.

    Please Login or Register  to view this content.

  3. #3
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Using variable from Input box to identify a cell

    Hi, brianf,

    did you consider to use VLookup for this instead of a macro? You could use Data/cValdiation for making the chocie and just fill the cells to only show values from Sheet1 when any valid number has been chosen.

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  4. #4
    Registered User
    Join Date
    08-09-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Using variable from Input box to identify a cell

    Client List.xlsmVLookup may be the better way to go but here's a sample of my spreadsheet. I need the Name, phone numbers and email address to be filled into the form.

  5. #5
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 2019 on Win10 (desktop), 2019 on Win11 (notebook)
    Posts
    8,197

    Re: Using variable from Input box to identify a cell

    Hi, brianf,

    for me the procedure should be located in a standard module, not behind the sheet. Code used:
    Please Login or Register  to view this content.
    An additional sheet for the demonstartion of formulas was attached as well.

    Ciao,
    Holger
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    08-09-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    Excel 2007
    Posts
    11

    Re: Using variable from Input box to identify a cell

    Yes that works great! Thanks.

+ 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. Input Cell in One variable data table
    By Dottore Magistrale in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 04:05 PM
  2. Input Cell in One variable data table
    By Dottore Magistrale in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 03:05 PM
  3. Input Cell in One variable data table
    By Dottore Magistrale in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-06-2005, 10:05 AM
  4. [SOLVED] Input Cell in One variable data table
    By Dottore Magistrale in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 11:05 PM
  5. Input Cell in One variable data table
    By Dottore Magistrale in forum Excel Formulas & Functions
    Replies: 0
    Last Post: 09-05-2005, 10:05 PM

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