Hello you guys,
I have created a userform with a combobox with a dropdown list.
I am currently having trouble creating a combobox which performs searches as I type into it.
For example if I type los then it will automatically searches anything that has "los" that is los alamitos, los angeles, calosaga, etc.
This is what code I have so far in the frmInputs as the name of my userform.
Const header = "C5,a"
Const mySheet = "Sheet1"
Private Sub CommandButton1_Click()
If UBound(headerArr) Mod 2 <> 1 Then MsgBox "Error in Cell Address & Header pair"
For a = 0 To (UBound(headerArr) - 1) / 2
Range(headerArr(a * 2)).Offset(0, 1) = InputBox(headerArr(a * 2 + 1), "Field Entry")
Next
End Sub
Private Sub cmdOK_Click()
headerArr = Split(header, ",")
Set sht = Worksheets(mySheet)
For a = 0 To (UBound(headerArr) - 1) / 2
sht.Range(headerArr(a * 2)) = Controls("TextBox" & (a + 1))
Next
End Sub
and on my Sheet1:
Private Sub CommandButton1_Click()
Load frmInputs
frmInputs.Show
End Sub
Thank you in advance and I hope there is a way on it.
I have created a userform with a combobox with a dropdown list.
I am currently having trouble creating a combobox which performs searches as I type into it.
For example if I type los then it will automatically searches anything that has "los" that is los alamitos, los angeles, calosaga, etc.
This is what code I have so far in the frmInputs as the name of my userform.
Const header = "C5,a"
Const mySheet = "Sheet1"
Private Sub CommandButton1_Click()
If UBound(headerArr) Mod 2 <> 1 Then MsgBox "Error in Cell Address & Header pair"
For a = 0 To (UBound(headerArr) - 1) / 2
Range(headerArr(a * 2)).Offset(0, 1) = InputBox(headerArr(a * 2 + 1), "Field Entry")
Next
End Sub
Private Sub cmdOK_Click()
headerArr = Split(header, ",")
Set sht = Worksheets(mySheet)
For a = 0 To (UBound(headerArr) - 1) / 2
sht.Range(headerArr(a * 2)) = Controls("TextBox" & (a + 1))
Next
End Sub
and on my Sheet1:
Private Sub CommandButton1_Click()
Load frmInputs
frmInputs.Show
End Sub
Thank you in advance and I hope there is a way on it.