LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Need help with For-Next block

Perhaps...

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

"Bob" wrote in message
...
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.








 
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
End if without Block If Carrie_Loos via OfficeKB.com Excel Worksheet Functions 7 May 14th 08 06:47 PM
end if without block if Dirk Nachbar Excel Programming 2 July 20th 07 05:12 PM
End If without Block If Error Help Bull Excel Programming 6 April 30th 07 08:24 PM
if/then block within another if/then block needs a loop Janis Excel Programming 1 September 8th 06 10:01 PM
Block If DA@PD[_2_] Excel Programming 16 December 17th 05 01:57 AM


All times are GMT +1. The time now is 12:31 PM.

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

About Us

"It's about Microsoft Excel"