Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks, Claus, but now it errors on the Loop statement at the bottom of the sub routine. The first conditional generates a report based upon the supervisor's name (Class)- so, it will loop as long as the supervisor's name stays the same. On the second conditional, the report is generated by the employee's surname without regard to the supervisor's name (Class). If worse comes to worse, I can always put the conditional at the top of the sub routine, duplicate the remainder of the module under a different name, and then have the conditional send the execution of the code to that subroutine.
On Tuesday, January 13, 2015 at 12:57:08 PM UTC-6, wrote: 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
If Statement - no idea where to start! | New Users to Excel | |||
Loop through a range using a specific start and end | Excel Programming | |||
How to start a macro with a if statement | Excel Programming | |||
Why does a loop start ? | Excel Programming | |||
From worksheet enter DO-Loop start & end code | Excel Programming |