LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 33
Default Start Do/Loop within conditional statement

Hi,
Is it possible to start a Do/Loop with a conditional statement? The code I have is:

If Education = False Then
Class = Range("H" & LastRow).Value
Do While Cells(LastRow, 8).Value = Class And LastRow < 1
Else
Do While LastRow < 1
Class = Range("H" & LastRow).Value
End If

and this is nested in a For/Next routine. When I attempt to run it, I get a "Compile error: Else without If." There is a similar error if I try to use Select/Case routine. If what I'm trying to do isn't possible, then is there a work around to it?
Thanks,
James
 
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
If Statement - no idea where to start! Mattymoo New Users to Excel 4 May 22nd 08 12:51 AM
Loop through a range using a specific start and end luci Excel Programming 3 October 3rd 07 11:58 AM
How to start a macro with a if statement Philippe_seattle Excel Programming 1 October 24th 06 04:57 AM
Why does a loop start ? No Name Excel Programming 4 May 14th 04 07:53 PM
From worksheet enter DO-Loop start & end code Bob Leonard[_2_] Excel Programming 1 December 1st 03 09:42 PM


All times are GMT +1. The time now is 08:56 PM.

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

About Us

"It's about Microsoft Excel"