Hi All,
I use command buttons quite a lot and like them for the workbooks I use.
I have about 20 command buttons on a new sheet I have set up but I keep getting a problem that I need help with.
The issue I have is all the auto filters work fine using the command button except when I filter a certain range and nothing is in that range that is still "In progress" so the rows stay empty. All this is fine until I come to filter the next range, it looks like that because the screen is empty (below the auto filter line) the next filter won't work. So I need to know if I am missing something. When the screen is populated there are no issues.
A standard auto filter for the command button is below.
Any help would be appreciated.
Private Sub CommandButton5_Click()
On Error GoTo Err_Handler
Selection.AutoFilter Field:=12, Criteria1:="Powder", Operator:=xlAnd
Selection.AutoFilter Field:=13, Criteria1:="In progress", Operator:=xlAnd
Exit Sub
Err_Handler:
If Err.Number = 1004 Then
Resume Next
Else
MsgBox Err.Number & ": " & Err.Description
End If
End Sub
Thanks again.
Craig
I use command buttons quite a lot and like them for the workbooks I use.
I have about 20 command buttons on a new sheet I have set up but I keep getting a problem that I need help with.
The issue I have is all the auto filters work fine using the command button except when I filter a certain range and nothing is in that range that is still "In progress" so the rows stay empty. All this is fine until I come to filter the next range, it looks like that because the screen is empty (below the auto filter line) the next filter won't work. So I need to know if I am missing something. When the screen is populated there are no issues.
A standard auto filter for the command button is below.
Any help would be appreciated.
Private Sub CommandButton5_Click()
On Error GoTo Err_Handler
Selection.AutoFilter Field:=12, Criteria1:="Powder", Operator:=xlAnd
Selection.AutoFilter Field:=13, Criteria1:="In progress", Operator:=xlAnd
Exit Sub
Err_Handler:
If Err.Number = 1004 Then
Resume Next
Else
MsgBox Err.Number & ": " & Err.Description
End If
End Sub
Thanks again.
Craig