Morning,
I'm brand new to this forum, and pretty new to Excel/VBA, so please be patient as I learn the lingo. My issue - I have created a userform that has a ComboBox with a pre-defined list, not to be changed. The macro runs without issue and will populate the specified row with the user inputted data, including the checkboxes. However, the ComboBox does not show the list that I created. The idea is that the userform will have a dropdown for the user to select from a pre-defined list and have that populate a specified cell. I even tried to create it as a ListBox but have the same issue. This is my first time creating a userform so obviously missing a key step here. The entire code is below. If the code is ok, is there something else that needs to happen to show the dropdown list?
Thanks!
I appreciate any and all advice you can give.
I'm brand new to this forum, and pretty new to Excel/VBA, so please be patient as I learn the lingo. My issue - I have created a userform that has a ComboBox with a pre-defined list, not to be changed. The macro runs without issue and will populate the specified row with the user inputted data, including the checkboxes. However, the ComboBox does not show the list that I created. The idea is that the userform will have a dropdown for the user to select from a pre-defined list and have that populate a specified cell. I even tried to create it as a ListBox but have the same issue. This is my first time creating a userform so obviously missing a key step here. The entire code is below. If the code is ok, is there something else that needs to happen to show the dropdown list?
Thanks!
I appreciate any and all advice you can give.
VBA Code:
Private Sub CommandButton1_Click()
ConnectionTracker.Show
End Sub
Private Sub Userform_Initialize()
'Empty TargetCompany
TargetCompanyTextBox.Value = ""
'Empty Contact Name
NameTextBox.Value = ""
'Empty Contact's Company
CompanyTextBox.Value = ""
'Empty Contact's Title
TitleTextBox.Value = ""
'Empty Contact's Details
ContactDetailsTextBox.Value = ""
'Empty TouchPointComboBox
TouchPointComboBox.Clear
'Fill TouchPointComboBox
With TouchPointComboBox
.AddItem "Email"
.AddItem "Cold Call"
.AddItem "Meeting"
End With
'Set Focus on TargetCompanyTextBox
TargetCompanyTextBox.SetFocus
End Sub
Private Sub OkButton_Click()
Dim emptyRow As Long
'Make Sheet1 Active
Sheet1.Activate
'Determine emptyRow
emptyRow = WorksheetFunction.CountA(Range("A:A")) + 1
'Transfer information
Cells(emptyRow, 1).Value = TargetCompanyTextBox.Value
Cells(emptyRow, 2).Value = NameTextBox.Value
Cells(emptyRow, 3).Value = CompanyTextBox.Value
Cells(emptyRow, 4).Value = TitleTextBox.Value
Cells(emptyRow, 5).Value = ContactDetailsTextBox.Value
Cells(emptyRow, 6).Value = TouchPointComboBox.Value
If CheckBox1.Value = True Then Cells(emptyRow, 7).Value = CheckBox1.Caption
If CheckBox2.Value = True Then Cells(emptyRow, 7).Value = Cells(emptyRow, 7).Value & " " & CheckBox2.Caption
If CheckBox3.Value = True Then Cells(emptyRow, 7).Value = Cells(emptyRow, 7).Value & " " & CheckBox3.Caption
End Sub
Private Sub ClearButton_Click()
Unload Me
ConnectionTracker.Show
End Sub
Private Sub CancelButton_Click()
Unload Me
End Sub
Last edited by a moderator: