Even with all the help I've received on this forum, this code is practically finished, but I'm getting the "LOOP WITHOUT DO" error. And I know what that means, I just don't know where in the code the error is being triggered. There are literally no articles I can find commenting on this many criteria for an if statement.
I did get the code to work by adding "AND _" at the end of some of the lines, but not all the criteria were being met and was populating the result inaccurately. So I got rid of the "AND_" and started over. Does anyone have any hints they can give? I'm stuck here.
I did get the code to work by adding "AND _" at the end of some of the lines, but not all the criteria were being met and was populating the result inaccurately. So I got rid of the "AND_" and started over. Does anyone have any hints they can give? I'm stuck here.
Code:
Sub macro3()
'THIS SUB: looks at a set of parameters that must be met in order for AX:AZ to be populated
Dim lrow As Long
Dim wksht1 As Worksheet
ActiveWorkbook.Sheets("HazShipper").Select
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Set wksht1 = Worksheets("HazShipper")
lrow = wksht1.Cells(wksht1.Rows.Count, "A").End(xlUp).row
r = 2
Do Until r = 2 & lrow
[B][COLOR=#008000]'ALL OF THESE CRITERIA MUST BE MET[/COLOR][/B]
If Cells(r, 14).Value = "TRUE" Then
If Cells(r, 23).Value = "TRUE" Then
If Cells(r, 25).Value = "TRUE" Then
If Cells(r, 29).Value = "TRUE" Then
If Cells(r, 32).Value = "TRUE" Then
If Cells(r, 35).Value = "TRUE" Then
If Cells(r, 39).Value = "TRUE" Or Cells(r, 39).Value = "Within Limit" Then
If Cells(r, 40).Value = "TRUE" Then
If Cells(r, 42).Value = """" Then Cells(r, 41).Value = "FALSE" [B][COLOR=#008000]'error here?[/COLOR][/B]
If Len(Cells(r, 42)) > 0 Then Cells(r, 41).Value = "TRUE" [B][COLOR=#008000]'error here?[/COLOR][/B]
If Cells(r, 43).Value = "MATCH" Then
If Cells(r, 44).Value = "TRUE" Then
If Cells(r, 45).Value = "TRUE" Then
If Cells(r, 46).Value = "TRUE" Then
[B][COLOR=#008000]'IN ORDER FOR THESE TO POPULATE:[/COLOR][/B]
Cells(r, 51).Value = "No Action"
Cells(r, 52).Value = "No Error"
Cells(r, 53).Value = "Compliant"
End If
r = r + 1
Loop
End Sub
Last edited: