+ Reply to Thread
Results 1 to 3 of 3

VLOOKUP in VBA to show information in a FORM

  1. #1
    Registered User
    Join Date
    10-23-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    4

    VLOOKUP in VBA to show information in a FORM

    Hello everyone,

    I am very new to VBA and my writing may not look very advanced but I like to keep things simple :-)
    I am very close to solving my problem but I just can't get there.

    ContextI have a questionnaire and for each question, when the answer is no, a form opens. There is only 1 form for 100 questions so I have it set up so that the information input into the form each time the form is opened is linked to an error code (already assigned for each question). Therefore, when the form opens, there is a button to upload an error code which is then linked to the information they enter (which is entered into a number of text boxes). The information input is save to the "Summary of Results" tab.

    If the user later goes back to a previously answered question and wants to make a change, the form opens and they have to click on a button that will say something like "upload original entry". The code below works. It pulls the error code into the TxtPreviousEntry text box.

    Please Login or Register  to view this content.
    The Call TextPreviousEntry_Change is meant to call the Vlookup that I can't get to work.

    For the example below, the code is to have the Agent Name (TxtAgentName1 text box) show when they upload the error code.
    This is not working.

    Please Login or Register  to view this content.
    Can anyone see an obvious error?

    Any help would be greatly appreciated.

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: VLOOKUP in VBA to show information in a FORM

    You appear to be using relative references, I suspect that you might need absolute references. Try removing the square brackets.
    Martin

  3. #3
    Registered User
    Join Date
    10-23-2013
    Location
    Canada
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: VLOOKUP in VBA to show information in a FORM

    [QUOTE=mrice;3615329]You appear to be using relative references, I suspect that you might need absolute references. Try removing the square brackets.[/QUOTE

    Hello Martin,
    Thank you so much for getting back to me.
    Removing the square brackets did not work. It gives me the following error:
    Runtime error 1004: Unable to find the Vlookup property of the Worksheet Function Class

    ?

  4. #4
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: VLOOKUP in VBA to show information in a FORM

    Can you try just Application.Vlookup with the WorksheetFunction in the middle?

+ 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: 33
    Last Post: 02-14-2013, 01:51 AM
  2. Using User form to filter information based on information on sheet
    By nikadon in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-04-2013, 04:43 PM
  3. How to show/hide/unload form when form name is a string variable?
    By achmidt in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-13-2012, 06:21 PM
  4. How do I do? A personalized form, similar to Show data Form
    By Isaac in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-05-2006, 10:20 PM
  5. [SOLVED] How do I put my information form Excel into a Word Merge Form?
    By Jackie in forum Excel General
    Replies: 2
    Last Post: 03-16-2006, 04:20 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