Red over White
Board Regular
- Joined
- Jul 16, 2011
- Messages
- 132
- Office Version
- 365
- Platform
- MacOS
I am trying to hide columns where the Value in the cells on row 9 is "", that cell being populated with a formula where the result is "". However I am getting the Compile Error Message 'Next without For'. Any clues?
Sub GraphC()
Dim a As Integer
Dim ColumnVar As Variant
ColumnVar = Array("B", "C", "D", "E", "F", "G", "H", "I", "J", "K")
For a = 0 To 9
With Sheets("GraphC")
If Cells(a, "9").Value = "" Then
.Columns(a).EntireColumn.Hidden = True
End If
Next a
End With
End Sub
Sub GraphC()
Dim a As Integer
Dim ColumnVar As Variant
ColumnVar = Array("B", "C", "D", "E", "F", "G", "H", "I", "J", "K")
For a = 0 To 9
With Sheets("GraphC")
If Cells(a, "9").Value = "" Then
.Columns(a).EntireColumn.Hidden = True
End If
Next a
End With
End Sub