Boolean to advance loop

E

ExcelMonkey

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
 
B

Bob Phillips

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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads


Top