Hi all, apologies for duplication.
I am being driven slowly mad by my inability to get a simple piece of code working. I have a calendar that has days acroos the top and race series down the left. I want to be able to hide certain race series that I am not supporting this season by checking a box further down the sheet. For example, if I want to hide all of the rows that contain 'World Series', which is written in cell S161, I want to tick my check box next to this cell and have all rows that start with 'World Series' (in the A column range A1:A181) hidden. When the tick box is unticked, all the World Series rows are shown again.
This code currently stops and shows a compile error, Next without For. The tick box link cell is X161
I can supply the sheet if it helps, or a pdf of it so you can see what I am working on.
Sub CheckBox9_Click()
Application.ScreenUpdating = False
With ActiveSheet
If cell.Value("x161") = "TRUE" Then
For Each cell In Range("A1:A181")
If cell.Value = ("s161") Then
cell.EntireRow.Hidden = True
End If
If cell.Value = "FALSE" Then
cell.EntireColumn.Hidden = False
Next
Application.ScreenUpdating = True
Range("C9").Select
End Sub
Bookmarks