P
PBcorn
I want to run several consective tests on "curcell". Select case seemed less
messy than nested if-then. However I am getting the above error on the **
line. Help appreciated
Dim curcell As Range
Dim sht As Worksheet
For Each sht In ActiveWorkbook.Worksheets
For Each curcell In sht.UsedRange.Cells
Select Case curcell.Column
Case Is <> 1
Select Case curcell.Row
Case Is <> 1
Select Case TypeName(curcell.Offset(-1, 0))
**Case Is = "String" Or "Date"
Select Case TypeName(curcell.Offset(0, -1))
Case Is = "String" Or "Date"
Select Case curcell.Offset(-1, 0).Value
Case Is <> 2002 Or 2003 Or 2004 Or 2005 Or 2006 Or 2007 _
Or 2008 Or 2009
MsgBox curcell.Address
Exit For
End Select
End Select
End Select
End Select
End Select
Next curcell
Next sht
messy than nested if-then. However I am getting the above error on the **
line. Help appreciated
Dim curcell As Range
Dim sht As Worksheet
For Each sht In ActiveWorkbook.Worksheets
For Each curcell In sht.UsedRange.Cells
Select Case curcell.Column
Case Is <> 1
Select Case curcell.Row
Case Is <> 1
Select Case TypeName(curcell.Offset(-1, 0))
**Case Is = "String" Or "Date"
Select Case TypeName(curcell.Offset(0, -1))
Case Is = "String" Or "Date"
Select Case curcell.Offset(-1, 0).Value
Case Is <> 2002 Or 2003 Or 2004 Or 2005 Or 2006 Or 2007 _
Or 2008 Or 2009
MsgBox curcell.Address
Exit For
End Select
End Select
End Select
End Select
End Select
Next curcell
Next sht