ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Boolean to advance loop (https://www.excelbanter.com/excel-programming/325337-boolean-advance-loop.html)

ExcelMonkey[_190_]

Boolean to advance loop
 
I have a for each loop which loops through cells in a
worksheet. I jsut added a line of code that says if the
cell is blank, then don't continue on within loop and call
main sub, instead advance to next cell in loop. I tried
using the Next stmt but this is not working. How do you
do this?


For Each cell In sh.UsedRange
If IgnoreBlanksBttn = True And
Application.WorkbookFunction.Isblank(cell) = True Then 'New
Next 'New
End If 'New
Call MainAudit(ChkbxCtrlFind)
Next

Bob Phillips[_6_]

Boolean to advance loop
 
For Each cell In sh.UsedRange
If IgnoreBlanksBttn = True And
Application.WorkbookFunction.Isblank(cell) = True Then 'New
' do nothing
Else
Call MainAudit(ChkbxCtrlFind)
End If 'New

Next

--

HTH

RP
(remove nothere from the email address if mailing direct)


"ExcelMonkey" wrote in message
...
I have a for each loop which loops through cells in a
worksheet. I jsut added a line of code that says if the
cell is blank, then don't continue on within loop and call
main sub, instead advance to next cell in loop. I tried
using the Next stmt but this is not working. How do you
do this?


For Each cell In sh.UsedRange
If IgnoreBlanksBttn = True And
Application.WorkbookFunction.Isblank(cell) = True Then 'New
Next 'New
End If 'New
Call MainAudit(ChkbxCtrlFind)
Next





All times are GMT +1. The time now is 08:36 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com