+ Reply to Thread
Results 1 to 5 of 5

Combo Box Problem

  1. #1
    Forum Contributor
    Join Date
    04-09-2005
    Location
    Multan. Pakistan
    Posts
    129

    Question Combo Box Problem

    Hi Freinds,

    How we can build a ComboBox having data Source in Sheet2, and in Textbox1 i want to see the corresponding data of ComboBox. i.e column 2 of sheet2 (with vlookup function). Next I want to append the data in sheet1 using this combobox. I have some codes but an error appears saying "Method or data member not found". Can anybody help me.

    Thanks

    SYED HAIDER ALI

  2. #2
    Forum Contributor
    Join Date
    06-10-2004
    Location
    India
    Posts
    1,066
    Private Sub ComboBox1_Change()
    TextBox1 = Application.WorksheetFunction.VLookup(ComboBox1, Sheet2.Range("A1:B3"), 2, 0)
    Range("A10") = ComboBox1.Value
    Range("B10") = TextBox1.Value
    End Sub

    the first line looks up for the combobox value in sheet2
    the second and third lines put these values in the specified cells.
    And don't forget to assign the table to your combo-box though the property ListFillRange as mentioned in an earlier post.

    - Mangesh

  3. #3
    Forum Contributor
    Join Date
    04-09-2005
    Location
    Multan. Pakistan
    Posts
    129

    Re. ComboBox Problem

    Dear Mangesh,

    I found it my fault, In vlookup formula, i was using Sheet Name as "Party.Range("a2:b1000") instead of Sheet No. as "sheet2.range("a1:b1000"). That's why the message was coming "Method or data member not found".

    Thanks for your reply.

    SYED HAIDER ALI

  4. #4
    Forum Contributor
    Join Date
    06-10-2004
    Location
    India
    Posts
    1,066
    If you want to use the sheet name, then you can change it to:

    Worksheets("Party").Range("a2:b1000")


    - Mangesh

  5. #5
    Forum Contributor
    Join Date
    04-09-2005
    Location
    Multan. Pakistan
    Posts
    129

    Re: Combo Box

    Dear Mangesh,

    Thanks for your reply.

    Sincerly,
    Syed Haider Ali.

+ 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