Associate
- Joined
- 9 May 2005
- Posts
- 859
- Location
- Devon
Hi
I am helping a friend with a spreadsheet as years ago I used to do little VB coding but as ive just realised I have forgotten it all. Its going well apart from the filter reset button. I have made a quick example to show you as I don’t want to show you the original.
The problem is if you hit the reset filter button, and you haven’t selected a filter you get the run time error which obviously we do not want. At the moment the code for the reset button is
What can I add to it so you cannot click the button unless a filter has been selected? I know this is simple but I really can’t remember how.
Any help much appreciated
Slackjaw190
I am helping a friend with a spreadsheet as years ago I used to do little VB coding but as ive just realised I have forgotten it all. Its going well apart from the filter reset button. I have made a quick example to show you as I don’t want to show you the original.

The problem is if you hit the reset filter button, and you haven’t selected a filter you get the run time error which obviously we do not want. At the moment the code for the reset button is
.Private Sub ToggleButton1_Click()
ActiveSheet.ShowAllData
End Sub
Private Sub CommandButton1_Click()
ActiveSheet.ShowAllData
End Sub
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
End Sub
What can I add to it so you cannot click the button unless a filter has been selected? I know this is simple but I really can’t remember how.
Any help much appreciated
Slackjaw190