PDA

View Full Version : RUNTIME 13: TYPE MISMATCH ERROR



DeanP
07-10-2019, 03:45 AM
When my workbook opens, I want it to open on a specific worksheet, and hide a few of the rows in that worksheet.

My code is:

Private Sub Workbook_Open()

ThisWorkbook.Sheets("Guide").Activate


ThisWorkbook.Sheets("Guide").Rows("9-60").EntireRow.Hidden = True

End Sub

I get mismatch error in the hide rows line of this macro and cannot work out why? Any ideas?

Fluff
07-10-2019, 04:47 AM
Replace the - with :

Artik
07-10-2019, 06:44 AM
Me.Sheets("Guide").Rows("9:60").Hidden = True

Artik