+ Reply to Thread
Results 1 to 6 of 6

Issue with VLOOKUP in Excel UserForm

  1. #1
    Registered User
    Join Date
    05-09-2018
    Location
    Swindon, England
    MS-Off Ver
    MS Office 2013
    Posts
    3

    Issue with VLOOKUP in Excel UserForm

    Hi

    I've created a UserForm in Excel where I want 3 columns to be auto-filled alongside the data entered on the form (see image):
    convolog.png

    I've written the following code to achieve this, but the VLOOKUP keeps pulling the data from the first line of the table, not the data that corresponds to the lookup value (in this case a person's name, as I've demonstrated in the image):

    Please Login or Register  to view this content.
    Any help would be appreciated! This is my first time using VBA so keep it simple if possible please!
    Last edited by smha; 05-09-2018 at 10:00 AM.

  2. #2
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Issue with VLOOKUP in Excel UserForm

    Hi,

    Please edit your post to include code tags, per the forum rules.

    Then, is the data on the source sheet sorted in alphabetical order on column A? It must be for you to be able to use True as the 4th argument for VLookup- in all honestly I would expect False when matching names. It would also be more efficient to use Match to locate the row position and then simply refer to the cells directly.
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  3. #3
    Registered User
    Join Date
    05-09-2018
    Location
    Swindon, England
    MS-Off Ver
    MS Office 2013
    Posts
    3

    Re: Issue with VLOOKUP in Excel UserForm

    Hi

    Thanks for your reply. I've edited my post as requested.

    It would also be more efficient to use Match to locate the row position and then simply refer to the cells directly.
    In terms of the above suggestion, how would this work in practical terms? Like I mentioned in my first post I'm a novice at this so I'm not sure how to use the Match function in this context!

    Thanks again

  4. #4
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Issue with VLOOKUP in Excel UserForm

    It would look something like this
    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    05-09-2018
    Location
    Swindon, England
    MS-Off Ver
    MS Office 2013
    Posts
    3

    Re: Issue with VLOOKUP in Excel UserForm

    Thanks for all your help, it's working great now

  6. #6
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Issue with VLOOKUP in Excel UserForm

    You're welcome.

+ 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. Issue opening multiple hyperlinks from Excel via Userform
    By chrisellis250 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-16-2018, 06:43 AM
  2. [SOLVED] Userform TextBox1.Text in vlookup issue
    By PFDave in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-23-2016, 06:19 AM
  3. [SOLVED] Userform issue Excel 2010
    By jdoerr1021 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-21-2015, 06:21 AM
  4. Userform in Excel for mac 2013: making dependent combo box issue
    By tsiguy96 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-19-2015, 12:00 PM
  5. [SOLVED] Hyperlink issue on excel userform
    By Maggie6360 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 08-06-2015, 04:24 PM
  6. Issue with VLookup within userform for editing data from row based on FirstField
    By Orestees in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-17-2012, 01:56 PM
  7. Excel VBA 2007 - Userform scrollbar with frame focus issue
    By chiuyian82 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-15-2010, 05:10 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