Mike,
I should have been more clear in my objective. My apologies.
If the IF-block evaluates to True, not only do I need to increment "x" by 1,
but I also need to skip the "... more instructions ..." section, too. That's
the part I'm struggling with.
Thanks again for the help.
Bob
> Bob,
>
[quoted text clipped - 20 lines]
> >
> > Thanks in advance for any help.
Mike H - 25 Sep 2007 13:52 GMT
Bob,
There will probably be cries of outrage and spaghetti code accusations but
I'd use Goto like this
For x = 1 To 10
If RowIsBlank(8) = True Then
Application.DisplayAlerts = False
Workbooks(TargetFile(x)).Close
Application.DisplayAlerts = True
Goto 100
End If
... more instructions ...
100
Next x
X will then increment by 1 when it reaches Next X
Mike
> Mike,
> I should have been more clear in my objective. My apologies.
[quoted text clipped - 30 lines]
> > >
> > > Thanks in advance for any help.
Bob - 25 Sep 2007 14:06 GMT
Mike,
I, too, prefer NOT to use Goto. JW suggested using an Else clause which did
the trick. Thanks all the same.
Bob
> Bob,
>
[quoted text clipped - 50 lines]
> > > >
> > > > Thanks in advance for any help.
JW - 25 Sep 2007 13:58 GMT
Not to take anything away from Mike's code, but I still believe that a
simple Else clause is all you need.
Do this if true
Else
Do this if false
Next x
Seems to me to be exactly what you want. See the code I posted
earlier. If I am completely lost, then please set me straight.
> Mike,
> I should have been more clear in my objective. My apologies.
[quoted text clipped - 30 lines]
> > >
> > > Thanks in advance for any help.
Mike H - 25 Sep 2007 14:06 GMT
JW,
I agree your solution is much neater.
Mike
> Not to take anything away from Mike's code, but I still believe that a
> simple Else clause is all you need.
[quoted text clipped - 40 lines]
> > > >
> > > > Thanks in advance for any help.