+ Reply to Thread
Results 1 to 4 of 4

Vlookup VBA Error

  1. #1
    Registered User
    Join Date
    09-01-2009
    Location
    southampton
    MS-Off Ver
    Excel 2007
    Posts
    32

    Vlookup VBA Error

    Hello

    i have a userform which has a combo box called "GoldCB", a text box called "Tbbranch" and a text box called "tbpost". the below code populates the "tbbranch" with whatever is chosen in "Goldcb" and then the vlookup code looks up the tbbranch value in a named range"goldtarget" and gives me the post code and populates "tbpost".

    thw code works fine however whenever i clear the userform i get the following error Run-time error '-2147352571 (80020005)':
    Clould not set the Value Property. type mismatch. if i then debug it highlights vlookup code below in yellow.



    Please Login or Register  to view this content.
    help is greatly appreciated.

    Matt
    Last edited by perrymagic; 12-29-2011 at 07:37 AM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Vlookup VBA Error

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Contributor
    Join Date
    12-28-2011
    Location
    England
    MS-Off Ver
    Excel 2007
    Posts
    280

    Re: Vlookup VBA Error

    You could simply ignore this error eg:

    Please Login or Register  to view this content.
    which will probably work fine. Alternatively, you would need to construct a way in which the code is not executed if the userform is cleared.

  4. #4
    Registered User
    Join Date
    09-01-2009
    Location
    southampton
    MS-Off Ver
    Excel 2007
    Posts
    32

    Re: Vlookup VBA Error

    blimey something so simple but has taken me ages!!

    thanks very much. perfect!!

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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