D
deen
Dear All,
This program run in the work sheet , its working fine. but need to use
the program in use of command button is not working fine ,
can any body sort out issue(same program run thru command button).
Private Sub Worksheet_Change(ByVal Target As Range)
Const inputCell = "$B$1" ' must have the $ symbols
If Target.Address <> inputCell Then
Exit Sub
End If
Application.ScreenUpdating = False
Range("B2").Select ' get read to set AutoFilter
If IsEmpty(Target) Or _
Trim(Target) = "" Or _
UCase(Trim(Target)) = "ALL" Then
'need to show all
Selection.AutoFilter field:=2
Else
'need to filter by B1 entry
Selection.AutoFilter field:=2,
Criteria1:=UCase(Trim(Target.Value))
End If
Range(inputCell).Select
Application.ScreenUpdating = True
End Sub
Regars,
Deen
This program run in the work sheet , its working fine. but need to use
the program in use of command button is not working fine ,
can any body sort out issue(same program run thru command button).
Private Sub Worksheet_Change(ByVal Target As Range)
Const inputCell = "$B$1" ' must have the $ symbols
If Target.Address <> inputCell Then
Exit Sub
End If
Application.ScreenUpdating = False
Range("B2").Select ' get read to set AutoFilter
If IsEmpty(Target) Or _
Trim(Target) = "" Or _
UCase(Trim(Target)) = "ALL" Then
'need to show all
Selection.AutoFilter field:=2
Else
'need to filter by B1 entry
Selection.AutoFilter field:=2,
Criteria1:=UCase(Trim(Target.Value))
End If
Range(inputCell).Select
Application.ScreenUpdating = True
End Sub
Regars,
Deen