View Single Post
 
Old 01-12-2015, 08:37 AM
Doug Needham Doug Needham is offline Windows 7 64bit Office 2013
Novice
 
Join Date: Nov 2014
Posts: 20
Doug Needham is on a distinguished road
Default Run Time Error 424 - Object Required

I have a toggle button in my spreadsheet that has become "inactive". Nothing happens when I click it. When I view the code (shown below) and hit F5, I get a Run Time Error 424 - Object Required error message. This macro has worked in the past. Also, this issue is occurring on multiple spreadsheets that also have toggle buttons, although the code is different in the other spreadsheets.

It appears that something has happened in Excel to cause this problem because it's occurring in different Excel files with different code.


Private Sub ToggleButton1_Click()

If ToggleButton1.Value = True Then
'This area contains the things you want to happen
'when the toggle button is not depressed
ActiveSheet.Range("$B$6:$N$319").AutoFilter Field:=4, Criteria1:="<>"
Range("A1").Select


Else
'This area contains the things you want to happen
'when the toggle button is depressed
ActiveSheet.ShowAllData
Range("A1").Select
End If

End Sub
Reply With Quote