Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Compile error: Loop WIthout Do

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Compile error: Loop WIthout Do

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
help with this error-Compile error: cant find project or library JackR Excel Discussion (Misc queries) 2 June 10th 06 09:09 PM
error message: compile error, argument not optional Pierre via OfficeKB.com Excel Programming 3 September 5th 05 03:45 PM
How do I get rid of "Compile error in hidden module" error message David Excel Discussion (Misc queries) 4 January 21st 05 11:39 PM
Compile error in hidden module error Melissa Zebrowski Excel Programming 3 February 20th 04 01:29 PM


All times are GMT +1. The time now is 01:33 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"