Greetings,

I am looking for a code to create a macro which performs the following :

Checks the values of all the cells in a given row.
If cell value equals "OK", then hide column.

I have found this code which seems to work for hiding rows, but i cannot modify it right to hide columns :

Sub HideRows()
BeginRow = 1
EndRow = 100
ChkCol = 3

For RowCnt = BeginRow To EndRow
If Cells(RowCnt, ChkCol).Value < 5 Then
Cells(RowCnt, ChkCol).EntireRow.Hidden = True
End If
Next RowCnt
End Sub

Can anyone help?
Thanks in advance,

Regards,