Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The value in F is either less than 10 or greater than 10. Value is a
variable date in columns D, G & E. If Col F result is 10 or more, and G2 is = D2, THEN COMPLIANT If Col F result is 10 or more, and G2 is < D2, THEN NONCOMPLIANT If Col F result is <10, and E3 is = D3, THEN COMPLIANT If Col F result is <10, and E3 is < D3, THEN NONCOMPLIANT |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub AABBCC()
Dim rngF as Range, rngG as Range, rngD as Range Dim rngD1 as Range, rngE as Range Dim i as Long For i = 2 To 202 Set rngF = Cells(i, "F") Set rngG = Cells(i, "G") Set rngD = Cells(i, "D") Set rngD1 = Cells(i + 1, "D") Set rngE = Cells(i + 1, "E") If rngF 10 And rngG = rngD Then res = "COMPLIANT" ElseIf (rngF 10 And rngG < rngD) Then res = "NONCOMPLIANT" ElseIf (rngF < 10 And rngE = rngD1) Then res = "COMPLIANT" ElseIf (rngF < 10 And rngE < rngD1) Then res = "NONCOMPLIANT" Else res = "anomaly" End If MsgBox "row: " & i & " result: " & res Next End Sub -- Regards, Tom Ogilvy "Gale" wrote in message ... The value in F is either less than 10 or greater than 10. Value is a variable date in columns D, G & E. If Col F result is 10 or more, and G2 is = D2, THEN COMPLIANT If Col F result is 10 or more, and G2 is < D2, THEN NONCOMPLIANT If Col F result is <10, and E3 is = D3, THEN COMPLIANT If Col F result is <10, and E3 is < D3, THEN NONCOMPLIANT |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Missed the change in criteria
Sub AABBCC() Dim rngF as Range, rngG as Range, rngD as Range Dim rngD1 as Range, rngE as Range Dim i as Long Set rngG = Cells(2, "G") Set rngD = Cells(2, "D") Set rngD1 = Cells(3, "D") Set rngE = Cells(3, "E") For i = 4 To 204 Set rngF = Cells(i, "F") If rngF = 10 And rngG = rngD Then res = "COMPLIANT" ElseIf (rngF = 10 And rngG < rngD) Then res = "NONCOMPLIANT" ElseIf (rngF < 10 And rngE = rngD1) Then res = "COMPLIANT" ElseIf (rngF < 10 And rngE < rngD1) Then res = "NONCOMPLIANT" Else res = "anomaly" End If MsgBox "row: " & i & " result: " & res Next End Sub -- Regards, Tom Ogilvy "Tom Ogilvy" wrote in message ... Sub AABBCC() Dim rngF as Range, rngG as Range, rngD as Range Dim rngD1 as Range, rngE as Range Dim i as Long For i = 2 To 202 Set rngF = Cells(i, "F") Set rngE = Cells(i + 1, "E") If rngF 10 And rngG = rngD Then res = "COMPLIANT" ElseIf (rngF 10 And rngG < rngD) Then res = "NONCOMPLIANT" ElseIf (rngF < 10 And rngE = rngD1) Then res = "COMPLIANT" ElseIf (rngF < 10 And rngE < rngD1) Then res = "NONCOMPLIANT" Else res = "anomaly" End If MsgBox "row: " & i & " result: " & res Next End Sub -- Regards, Tom Ogilvy "Gale" wrote in message ... The value in F is either less than 10 or greater than 10. Value is a variable date in columns D, G & E. If Col F result is 10 or more, and G2 is = D2, THEN COMPLIANT If Col F result is 10 or more, and G2 is < D2, THEN NONCOMPLIANT If Col F result is <10, and E3 is = D3, THEN COMPLIANT If Col F result is <10, and E3 is < D3, THEN NONCOMPLIANT |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How do I add cell values that are in different rows/columns? | Excel Worksheet Functions | |||
How do I add cell values that are in different rows/columns? | Excel Worksheet Functions | |||
Cell for Changing Multiple Values in other columns | Excel Worksheet Functions | |||
changing formulas to their result values | Excel Discussion (Misc queries) | |||
Changing cell values between columns with macro | Excel Programming |