For Each Statement still not working
The reply I received earlier this morning did not help.
Unfortunate. But don't you think the polite thing to do is to thank Carlos
anyway, and maybe provide some more specifics to him or any other helper in
the original thread?
--
Jim
"Jacqui" wrote in message
...
| My For Each Statement is not working as expected. Syntax is below. Is
the
| problem with the Application.CountA line? Basically if I enter duff
| information on my worksheet, the code will detect the first occurance of
an
| error but ignores subsequent rows on the sheet with known errors, ie non
| completion of cells K:N.
| Can anyone help fix? The reply I received earlier this morning did not
| help. I have stepped thru the code to view the values in the variables
but
| I'm not able to solve.
|
| Sub Qualifiers_Check()
|
| Set wks = ActiveWorkbook.Worksheets("Part B - Coding Details")
|
| With wks
|
| Set myRng = .Range("c20", .Cells(.Rows.Count, "c").End(xlUp))
|
| Set myRng = myRng.Resize(myRng.Count - 1)
|
| For Each myCell In myRng.Cells
| If IsEmpty(myCell.Value) = False And Not myCell.Font.Bold Then
| Set myRngToCheck = .Cells(myCell.Row, "k").Resize(1, 4)
| If Application.CountA(myRngToCheck) < myRngToCheck.Cells.Count
| Then
| Beep
| MsgBox "You have not supplied all the relevant information
| for this Segment type in Row " _
| & myCell.Row & " on the Coding Details Sheet - PLEASE
ENTER
| ALL DETAILS"
|
| End If
| End If
| Next myCell
|
| End With
|
| End Sub
|
|