Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I get a compile error: loop without do.
My code follows. What is wrong!? I see 2 Do's and 2 Loop's. Cells(1, 1).Select Selection.UnMerge Row = 2 Do Until Row 250 If Cells(Row, 1) = " " Then If Cells(Row + 2, 1) = "" Then Cells(Row + 3, 1).Select Selection.UnMerge End If End If Row = Row + 1 Loop 'unmerge topic and obj' Row = 3 Do Until Row 250 Cells(Row, 1).Select Selection.UnMerge Cells(Row + 1, 1).Select Selection.UnMerge If Row + 5 = "" Then Row = Row + 8 Else If Row + 6 = "" Then Row = Row + 9 Else Row = Row + 5 End If Loop |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You will also get this error when you are missing an End If or
End With. In your case, you're missing an End If immediately before the final Loop statement. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "darin kelberlau" wrote in message . .. I get a compile error: loop without do. My code follows. What is wrong!? I see 2 Do's and 2 Loop's. Cells(1, 1).Select Selection.UnMerge Row = 2 Do Until Row 250 If Cells(Row, 1) = " " Then If Cells(Row + 2, 1) = "" Then Cells(Row + 3, 1).Select Selection.UnMerge End If End If Row = Row + 1 Loop 'unmerge topic and obj' Row = 3 Do Until Row 250 Cells(Row, 1).Select Selection.UnMerge Cells(Row + 1, 1).Select Selection.UnMerge If Row + 5 = "" Then Row = Row + 8 Else If Row + 6 = "" Then Row = Row + 9 Else Row = Row + 5 End If Loop |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
help with this error-Compile error: cant find project or library | Excel Discussion (Misc queries) | |||
error message: compile error, argument not optional | Excel Programming | |||
How do I get rid of "Compile error in hidden module" error message | Excel Discussion (Misc queries) | |||
Compile error in hidden module error | Excel Programming |