scottishbigyin
New Member
- Joined
- Jul 3, 2022
- Messages
- 7
- Office Version
- 365
- Platform
- Windows
Hiya all been used guide in How to use a ComboBox with autocomplete and search as you type.
created a macro to reset all values, but if something in the field trigger the dropdown sub, I've added code in bold to work around this problem, but must be better way.
with reset macro doing Me.Office.Value = ""
Any advise or pointers, maybe someone has brought up the idea before.
Thanks
created a macro to reset all values, but if something in the field trigger the dropdown sub, I've added code in bold to work around this problem, but must be better way.
VBA Code:
Private Sub Office_DropButtonClick()
[B] If [Office_Reset] = 1 Then
Exit Sub
ElseIf [Office_Reset] > 1 Then[/B]
With Me.Office
.List = Worksheets("Location_Table").Range("A2", Worksheets("Location_Table").Cells(Rows.Count, "A").End(xlUp)).Value
.ListRows = Application.WorksheetFunction.Min(5, .ListCount)
.DropDown
End With
End If
End Sub
with reset macro doing Me.Office.Value = ""
Any advise or pointers, maybe someone has brought up the idea before.
Thanks