View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Mike H Mike H is offline
external usenet poster
 
Posts: 11,501
Default Need help with For-Next block

Bob,

Try

For x = 1 To 10
If RowIsBlank(8) = True Then
Application.DisplayAlerts = False
Workbooks(TargetFile(x)).Close
Application.DisplayAlerts = True
x=x+1
End If
... more instructions ...
Next x

Mike


"Bob" wrote:

I have the following code block:


but when I run the code, I receive the expected "Next without For" error
message.
I need to somehow increment "x" when the IF-block evaluates to True. Can
someone kindly tell me how to pull this off?

Thanks in advance for any help.