View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Bob Bob is offline
external usenet poster
 
Posts: 972
Default Need help with For-Next block

I have the following code block:

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

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.