Consulting

Results 1 to 4 of 4

Thread: how to lookup combo box into textbox in excel VBA

  1. #1
    VBAX Newbie
    Joined
    Feb 2020
    Posts
    5
    Location

    how to lookup combo box into textbox in excel VBA

    Hi guys

    Hope you are doing good.

    I have gotten the attached Excel sheet from internet and modified as per my requirement.

    But i having problem with some textbox which i (located in the sheet name "MAIN")newly added and does not populate the item description while the item code selected in combo box.

    If any one kindly solve this issue,it would be a great favor for me.

    Thanks

    Dawood
    Attached Files Attached Files

  2. #2
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,727
    Location
    Can't get past the username and password userform

    Also the project is protected
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

  3. #3
    VBAX Newbie
    Joined
    Feb 2020
    Posts
    5
    Location
    Quote Originally Posted by Paul_Hossler View Post
    Can't get past the username and password userform

    Also the project is protected
    Please ignore the previous file consider this as final.

    login credentials
    username: 1
    password: 1


    VBA password:
    1
    Attached Files Attached Files

  4. #4
    VBAX Sage
    Joined
    Apr 2007
    Location
    United States
    Posts
    8,727
    Location
    If I understand correctly ...

    Capture.JPG

    Private Sub cmbItem_Change()
        Me.txtPrice.Text = Application.WorksheetFunction.VLookup(cmbItem.Value, Worksheets("Items").Range("A:C"), 2, False)
        Me.txtDescription.Text = Application.WorksheetFunction.VLookup(cmbItem.Value, Worksheets("Items").Range("A:C"), 3, False)
    End Sub
    I recreated and renamed your 2 textboxes since there seemed to be something messed up with one

    Also changed your descriptions so I could make sure the right one was selected
    Attached Files Attached Files
    ---------------------------------------------------------------------------------------------------------------------

    Paul


    Remember: Tell us WHAT you want to do, not HOW you think you want to do it

    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •