I have entered this code in excel:
Sub KS3_NewTask()
Dim lColNo As Long
Dim blast As Boolean, bFound As Boolean
For lColNo = 1 To 150
If Columns(lColNo).Hidden Then
If blast Then
'---1ColNo is Col 2 of 4 for Task
bFound = True
Exit For
End If
End If
blast = Columns(lColNo).Hidden
Next lColNo
If bFound Then
'---unhide Cols 1,2,4 of Task
Columns(lColNo - 1).Resize(, 2).Hidden = False
Columns(lColNo + 2).Hidden = False
End Sub
I am new to it and have copied this code off a friend so not a 100% sure if correct, but i get an error message that says 'Block If without end If'. Not sure what it means, can you please show me how to sort it out?
Sub KS3_NewTask()
Dim lColNo As Long
Dim blast As Boolean, bFound As Boolean
For lColNo = 1 To 150
If Columns(lColNo).Hidden Then
If blast Then
'---1ColNo is Col 2 of 4 for Task
bFound = True
Exit For
End If
End If
blast = Columns(lColNo).Hidden
Next lColNo
If bFound Then
'---unhide Cols 1,2,4 of Task
Columns(lColNo - 1).Resize(, 2).Hidden = False
Columns(lColNo + 2).Hidden = False
End Sub
I am new to it and have copied this code off a friend so not a 100% sure if correct, but i get an error message that says 'Block If without end If'. Not sure what it means, can you please show me how to sort it out?