Changing my list box to a combo box

Robert Zeni

New Member
Joined
Oct 12, 2004
Messages
13
I recently changed my listbox to a combobox because i was having an issue when people were typing their searches it would only include 1 character. Is there a way i can continue using a listbox and have the search be more robust? If not when I changed the listbox to a combobox My selected command becomes invalid

Any help would be greatly appreciated

Private Sub ComboBox1_Change()

End Sub

Private Sub CommandButton1_Click()
Dim i As Integer, sht As String
For i = 0 To ComboBox1.ListCount - 1
If ComboBox1.Selected(i) = True Then
sht = ListBox1.List(i)
End If
Next i
Sheets(sht).Activate
End
End Sub

Private Sub CommandButton2_Click()
Unload UserForm1
End Sub



Private Sub UserForm_Initialize()
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ComboBox1.AddItem (ws.Name)
Next ws
End Sub
 

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.
Hi,

If I am understanding you correctly, the users will begin typing into the listbox so their entry will appear. It currently is stopping at the first letter and then they have to scroll down.

If so, change the MatchEntry property of the listbox to MatchEntryComplete. Right click on the listbox in design mode and set it there.

Ron
 
Upvote 0

Forum statistics

Threads
1,203,071
Messages
6,053,373
Members
444,658
Latest member
lhollingsworth

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top