+ Reply to Thread
Results 1 to 8 of 8

Vlookup in VBA not working properly with Forms

  1. #1
    Forum Contributor
    Join Date
    11-07-2005
    Posts
    280

    Vlookup in VBA not working properly with Forms

    Hi everyone,

    I have a VBA form with two ComboBoxes >>

    I used the following code with ComboBox1:

    Please Login or Register  to view this content.
    It is working perfectly,

    While using the same code with ComboBox2 is not working at all and gives me a Run-Time error 1004.

    This is the code used with ComboBox2:

    Please Login or Register  to view this content.
    I hope that you can help me solving this problem,

    Thank you in advance,

    bye,
    Last edited by LoveCandle; 08-31-2008 at 01:05 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
    I ssggest that you lok at the VBA .Find method instead.

    The other problem will be that the changes will continue tiggering each other.

    Combobox1 change event triggers combobox2 change event, which will then change combox1
    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
    11-07-2005
    Posts
    280
    Thank you MR. royUK for your reply and advice, but actually I tried may other ways and tested many codes to reach my goal but unfortunately I faild.

    So, can you please help me finding a replacement code that would solve my problem and make me reach my goal.

    Thanks,

  4. #4
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    I think you will need to address the problem of two interacting combobox changes first. Try attaching the workbook.

  5. #5
    Forum Contributor
    Join Date
    11-07-2005
    Posts
    280
    Thank you Mr. RoyUK for you interest and you man download my file from the following link:

    http://www.2shared.com/file/3862791/...est_From3.html

    bye,
    Last edited by LoveCandle; 09-02-2008 at 05:58 AM. Reason: Wrong Link

  6. #6
    Forum Contributor
    Join Date
    11-07-2005
    Posts
    280
    The link attached with my previous post was worng, I already corrected it.

    Thanks,

  7. #7
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200
    I'm not sure why you are using a second cobobox, but check this amended code

    Please Login or Register  to view this content.
    I would replace combobox2 with a textbox or label

  8. #8
    Forum Contributor
    Join Date
    11-07-2005
    Posts
    280
    Thank you Mr. royUK .. that is exaclty what I need,, by the way I have used Cells function for the same purpose in another code, but I don't no what made me stick to Vlookup Worksheet Function this time to reach my goal.

    Any how,, thanks alot again for your help,

+ 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. trim macro not working properly on large file
    By bernie1961 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-10-2008, 09:38 AM
  2. Vlookup using two columns-needs to match the first two column
    By pduubb in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 04-01-2008, 01:21 PM
  3. Loop For not working properly
    By mabbutt in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 02-12-2008, 08:59 AM
  4. VLOOKUP not working after so many cells
    By drgogo in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 01-30-2008, 06:48 AM
  5. Vlookup function not working if alphabet coming after '-' in the search term
    By ElerOcean in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 11-15-2007, 11:40 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