Does anyone know what I need to change to get this VBA code to work in Excel for Mac?
It works fine in Windows.
It is a show/hide toggle for rows while the caption on the button changes as well.
I used a form button (not ActiveX).
It works fine in Windows.
It is a show/hide toggle for rows while the caption on the button changes as well.
I used a form button (not ActiveX).
Code:
Sub HideDone()
Dim Shp As Shape
Set Shp = ActiveSheet.Shapes(Application.Caller)
If Shp.TextFrame.Characters.Text = "Hide Done" Then
Shp.TextFrame.Characters.Text = "Show All"
Range("A1").AutoFilter 10, "<>11. Published", xlAnd, "<>Cancelled"
Else
Shp.TextFrame.Characters.Text = "Hide Done"
ActiveSheet.ShowAllData
End If
End Sub
The message I get is
Run-time error 1004
Method 'TextFrame' of object 'Shape' failed
This code is highlighted in yellow
If Shp.TextFrame.Characters.Text = "Hide Done" Then
Last edited by a moderator: