Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Here's my code thus far:
For Each rCell In rOrigCtyList strOrig = rCell.Value strOutcomes = rCell.Offset(0, 3).Value lCurRow = rCell.Row If strOrig < "DYC" Then If strOutcomes < "DYC" Then If strOutcomes < strOrig Then lOrigCtyNo = Left(strOrig, 2) lOutcomesNo = Left(strOutcomes, 2) If lOrigCtyNo lOutcomesNo Then Range(rCell, rCell.Offset(0, 2)).Select Selection.Insert Shift:=xlDown rCell.Offset(-1, 0) = strOutcomes End If If lOrigCtyNo < lOutcomesNo Then Range(rCell.Offset(0, 3), rCell.Offset(0, 13)).Select Selection.Insert Shift:=xlDown rCell.Offset(0, 3) = strOrig End If End If Else Range(rCell.Offset(0, 3), rCell.Offset(0, 13)).Select Selection.Insert Shift:=xlDown rCell.Offset(0, 3) = strOrig End If Else: End Sub <-----ERROR End If Next rCell End Sub I'm getting a block if without end if error at the marked line. I've matched and rematched the If's and End Ifs. They match. So what am I missing to cause the error? I want to exit the program when strOrig < "DYC' is false. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Find and Replace causing a "Text" cell to become a custom date--wh | Excel Discussion (Misc queries) | |||
"Object Variable or With Block Variable Not Set" error help request | Excel Programming | |||
Adding "And" clause in SQL string causing SQL Syntax error | Excel Programming | |||
Need help in excel with "Statement invalid outside Type block. " error | Excel Programming | |||
"Run-time error 91: Object variable or With block not set" | Excel Programming |