Results 1 to 3 of 3

combo box value equals value of 2 text boxes

This is a discussion on combo box value equals value of 2 text boxes within the Excel Questions forums, part of the Question Forums category; Hello, I have a combo box entitled cmbSearch which I would like its value to be the joining values of ...

  1. #1
    Board Regular
    Join Date
    Nov 2008
    Posts
    100

    Default combo box value equals value of 2 text boxes

    Hello,

    I have a combo box entitled cmbSearch which I would like its value to be the joining values of textbox "txtLast" and textbox "txtFirst" with a comma and a space after the last name.

    The code I am using which I thought was pretty straight forward is below

    CODE
    ____________________________________________________________________

    'cmbSearch.Value = txtLast.Value & "," & " " & txtFirst.Value

    However, when I select my add command button only the last name appears on excel.

    Is there something obvious that I am missing.

    The final product should look like the below:

    Robertson, John

    Thanks in advance

  2. #2
    Board Regular
    Join Date
    May 2015
    Posts
    709

    Default Re: combo box value equals value of 2 text boxes

    Your syntax is a bit off:

    Code:
    Sheet1.ComboBox1.AddItem Sheet1.TextBox1.Text & "," & Sheet1.TextBox2.Text
    Tab indent for sanity.

  3. #3
    Board Regular
    Join Date
    Nov 2008
    Posts
    100

    Default Re: combo box value equals value of 2 text boxes

    thank you RedBeard!!

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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


DMCA.com