Hi experts. I currently have the following code (see below) in a worksheet I use at work. I would like to streamline the process to filter data by removing the command button to show all data and include "all" in the combobox. When "all" is selected in the combobox it should filter/show all data. Do you have any idea on how to do this?
Combobox Fill Data
Private Sub ComboBox1_DropButt*******()
Me.ComboBox1.ListFillRange = "Name"
End Sub
Advance Filter
Private Sub ComboBox1_Change()
On Error Resume Next
Sheet1.Range("E2") = Me.ComboBox1.Value
a = Application.WorksheetFunction.CountA(Sheet1.Range("A:A"))
Sheet1.Range("A" & 1, "D" & a).AdvancedFilter xlFilterInPlace, _
Sheet1.Range("E1:E2")
End Sub
Show All Data
Private Sub CommandButton1_Click()
On Error Resume Next
ActiveSheet.ShowAllData
End Sub
Combobox Fill Data
Private Sub ComboBox1_DropButt*******()
Me.ComboBox1.ListFillRange = "Name"
End Sub
Advance Filter
Private Sub ComboBox1_Change()
On Error Resume Next
Sheet1.Range("E2") = Me.ComboBox1.Value
a = Application.WorksheetFunction.CountA(Sheet1.Range("A:A"))
Sheet1.Range("A" & 1, "D" & a).AdvancedFilter xlFilterInPlace, _
Sheet1.Range("E1:E2")
End Sub
Show All Data
Private Sub CommandButton1_Click()
On Error Resume Next
ActiveSheet.ShowAllData
End Sub