Yodelayheewho
Member
I learning Macros and VBA by watching a tutorial video. I got about 1/3 of the way through the video and now I'm stuck.
The screenshot shows the video of the MACRO code and it works fine for the instructor.
I followed the video starting from a blank worksheet. So, I entered the exact same code for the MACRO above (except for the code: .Range("5:84").EntireRow.Hidden = True. My worksheet has more rows to hide.)
I'm getting the error message: Run-time error '1004': Method 'Range' of object' _Worksheet' failed
If I hover over the highlighted text "FirstRow", both say: "FirstRow=-35"
If I hover over the highlighted text ".EntireRow.Hidden = False, it says: ".Range(FirstRow & ":" & Fir... = < Method 'Range' of object '_Worksheet' failed>
I did some research and it was suggested I enter "With Sheet1" prior to the highlighted line of code.
I then get a Compile error: Expected End With
Any thoughts?
The screenshot shows the video of the MACRO code and it works fine for the instructor.
I followed the video starting from a blank worksheet. So, I entered the exact same code for the MACRO above (except for the code: .Range("5:84").EntireRow.Hidden = True. My worksheet has more rows to hide.)
I'm getting the error message: Run-time error '1004': Method 'Range' of object' _Worksheet' failed
If I hover over the highlighted text "FirstRow", both say: "FirstRow=-35"
If I hover over the highlighted text ".EntireRow.Hidden = False, it says: ".Range(FirstRow & ":" & Fir... = < Method 'Range' of object '_Worksheet' failed>
I did some research and it was suggested I enter "With Sheet1" prior to the highlighted line of code.
I then get a Compile error: Expected End With
Any thoughts?