I'm using form buttons with macros assigned to them on an instructions page, and according to which button is selected a range of rows is hidden.
I am getting a Method of range class failed
error for each of my macros, but if I debug the code and run it when I am on the AM Sheet, the code works.
How can I modify this so that it works from the instructions page? Did I forget to specify something?
Sub Daily()
Dim ws As Worksheet
Set ws = ThisWorkbook.Sheets("AM")
ws.Rows("22:80").Select
'Hide everything below daily
Selection.EntireRow.Hidden = True
ws.PageSetup.PrintArea = "$A$1:$I$21"
'Unselect everything
Range("A1").Select
Application.CutCopyMode = False
End Sub