+ Reply to Thread
Results 1 to 4 of 4

VlookUp in a Textbox Error

  1. #1
    Forum Contributor
    Join Date
    05-16-2011
    Location
    Philippines
    MS-Off Ver
    Excel 365/Excel 2016
    Posts
    315

    VlookUp in a Textbox Error

    I am trying to embed a vlookup formula into a textbox userform, and my columns are almost 300. I used a lookup formula and the returning column value is on Column 242 (Column IG). It works fine at first, but when I add a column in between and delete it afterward, it started to get messed, Instead of returning the value in Column IG, it returns the value from Col IH which is Column 243. I have another textbox that has the same code below but it works fine, just this textbox.

    Please Login or Register  to view this content.


    I have another option on using the index match formula instead. But I have no idea of how to embed it on a textbox.
    Last edited by emina002; 05-29-2021 at 11:11 AM.

  2. #2
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: VlookUp in a Textbox Error

    How is cmbFrame populated?
    If posting code please use code tags, see here.

  3. #3
    Forum Contributor
    Join Date
    05-16-2011
    Location
    Philippines
    MS-Off Ver
    Excel 365/Excel 2016
    Posts
    315

    Re: VlookUp in a Textbox Error

    @norie cmbframe is a combo box, It has a value already that created through name range. So whenever I choose a value in a combo box, all value in a textbox is auto-populated.

  4. #4
    Forum Guru Norie's Avatar
    Join Date
    02-02-2005
    Location
    Stirling, Scotland
    MS-Off Ver
    Microsoft Office 365
    Posts
    19,643

    Re: VlookUp in a Textbox Error

    I realise it's a combobox, I'm asking how it's been populated as that might help with your current issue.

    For example, you might be able to use the ListIndex property of the combobox to determine which row the currently selected item comes from and in turn use that to get the value for the textbox.

    As for adding/deleting/moving columns being a problem you might be able to use Application.Match to find the column number.

    For that to work you would need to have some sort of header row.

+ 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. [SOLVED] USERFORM/Textbox, Error 13, when TextBox is empty
    By StreetSweeper1 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-26-2021, 07:02 PM
  2. [SOLVED] Writing into random cell base on textbox values, Error if textbox have Multiple values
    By petroes in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 04-11-2020, 10:23 AM
  3. [SOLVED] application vlookup error runtime error 1004, unable to get the vlookup property of the.."
    By dmcgov in forum Excel Programming / VBA / Macros
    Replies: 23
    Last Post: 12-05-2018, 12:03 PM
  4. Excel 2010 – VBA Userforms – Vlookup via Textbox, display result in another textbox
    By theshybutterfly in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 03-29-2015, 12:31 AM
  5. vlookup using textbox on VB
    By mick1979 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 08-08-2013, 02:19 AM
  6. [SOLVED] VBA UserForm - Have entry in TextBox fill Another TextBox by VLOOKUP
    By msquared99 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 07-26-2012, 10:24 PM
  7. Use textbox input and VLookup to update another textbox on same userform
    By gcoug in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-22-2011, 10:39 AM

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