LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 99
Default Next inside If

I have something like

For Each cel in Sheets("Mate").Range(A1:A10000).Cells
If IsEmpty(cel.Value) then Next cel
If ......
.....
End If
Next cel

This fails with a "Next without For" message.

To make it work I have changed the code to

For Each cel in Sheets("Mate").Range(A1:A10000).Cells
If IsEmpty(cel.Value) then GoTo MyLabel
If ......
.....
End If
MyLabel:
Next cel


But I wonder if it can be done, without the GoTo statement?

Jan


 
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
Several AND operators inside an IF... SpeeD Excel Programming 2 February 4th 09 10:41 PM
I need to use more than 7 formulas inside each other ghnogueira Excel Discussion (Misc queries) 4 March 13th 07 01:52 PM
2 cells inside of one Dumber than a pocket full of rocks New Users to Excel 2 July 3rd 06 11:20 PM
add inside borders Reney Excel Discussion (Misc queries) 3 November 11th 05 02:53 PM
trying to email .xla inside/with .xls jrd269 Excel Discussion (Misc queries) 3 June 2nd 05 03:58 PM


All times are GMT +1. The time now is 08:46 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"