View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] goss9394@yahoo.com is offline
external usenet poster
 
Posts: 25
Default If Then Else with Exit For

Hi all

Not sure why my code is failing
Debug comesback highlighted at ELSE

Error is Else without IF

Thanks
-goss

Code :

Option Explicit

Sub TestValue()
Dim c As Range
Dim blnTest As Boolean

blnTest = False

For Each c In Range("C:C")
If blnTest = True Then Exit For
Else
If IsNumeric(c) Then c.EntireColumn.Hidden
blnTest = True
End If
End If
Next c
End Sub