+ Reply to Thread
Results 1 to 7 of 7

Unable to enable Vlookup in Userform

  1. #1
    Registered User
    Join Date
    12-11-2019
    Location
    london
    MS-Off Ver
    2007
    Posts
    50

    Unable to enable Vlookup in Userform

    Hi Guys,

    I am trying to load date in small textboxes via Vlookup when a Milestone in the ComboBox is chosen I, however get a runtime 1004 error when trying to do this.
    Can anybody help out.

    When Milstone X is picked then fill out textbox one-to-four from topdown.

    and vice-verca, when client is picked and textbox is populated->then get the ability to change the value for each independent elements per milestone :0

    I have attached the workbook and believe I am almost there.
    Attached Files Attached Files

  2. #2
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,913

    Re: Unable to enable Vlookup in Userform

    You haven't declared GetRange anywhere that I can see.
    Rory

  3. #3
    Registered User
    Join Date
    12-11-2019
    Location
    london
    MS-Off Ver
    2007
    Posts
    50

    Re: Unable to enable Vlookup in Userform

    Yes you are absolutely right. I have fixed that and set the range as a global range.
    I, however still have the issue.

    Updated workbook attached
    Attached Files Attached Files

  4. #4
    Forum Guru bakerman2's Avatar
    Join Date
    10-03-2012
    Location
    Antwerp, Belgium
    MS-Off Ver
    MO Prof Plus 2016
    Posts
    6,908

    Re: Unable to enable Vlookup in Userform

    Please Login or Register  to view this content.
    Last edited by bakerman2; 03-02-2020 at 05:32 AM.
    Avoid using Select, Selection and Activate in your code. Use With ... End With instead.
    You can show your appreciation for those that have helped you by clicking the * at the bottom left of any of their posts.

  5. #5
    Registered User
    Join Date
    12-11-2019
    Location
    london
    MS-Off Ver
    2007
    Posts
    50

    Re: Unable to enable Vlookup in Userform

    Hi Bakerman2,

    Wow that was an easy way and really clean.
    Thanks a lot.

  6. #6
    Forum Expert rorya's Avatar
    Join Date
    08-13-2008
    Location
    East Sussex, UK
    MS-Off Ver
    365 Ent Monthly Channel / Insiders Beta
    Posts
    8,913

    Re: Unable to enable Vlookup in Userform

    You made GetRange one column and still didn't declare it properly. You need to add

    Please Login or Register  to view this content.
    to the top of the userform code above all procedures. Then in the Initialize event it needs to be set to the entire range you need to use (and bear in mind when assigning the column numbers you want back that your first two columns are merged).

  7. #7
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,304

    Re: Unable to enable Vlookup in Userform

    Without going any further get rid of all your merged cells.
    They are the "kiss of death" for VBA.
    There are plenty of articles on the 'web' condemning their use.

+ 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] Unable to Get userForm to Recognise code. With Error message regarding VLookup
    By Mark Dynes in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 03-08-2017, 01:20 PM
  2. Error trying to import userform into Outlook: Unable to load UserForm.FRX
    By jeffclanders in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-08-2016, 12:36 PM
  3. Unable to Enable Macros in .xlsm File
    By Gos-C in forum Excel General
    Replies: 6
    Last Post: 09-10-2015, 06:23 AM
  4. Replies: 7
    Last Post: 11-25-2014, 10:32 AM
  5. [SOLVED] How to enable userform
    By NJH88 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-20-2013, 07:18 AM
  6. [SOLVED] Changed userform combobox to listbox, unable to get userform to retrieve datasheet values
    By dragonabsurdum in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-29-2013, 01:38 PM
  7. Replies: 3
    Last Post: 11-08-2012, 07:25 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