Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default help in VB for cell values changing in rows & columns w/result in

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default help in VB for cell values changing in rows & columns w/result in

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default help in VB for cell values changing in rows & columns w/result in

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I add cell values that are in different rows/columns? divadiva Excel Worksheet Functions 1 October 12th 09 04:28 AM
How do I add cell values that are in different rows/columns? divadiva Excel Worksheet Functions 1 October 12th 09 03:24 AM
Cell for Changing Multiple Values in other columns Nadine Excel Worksheet Functions 3 December 13th 08 10:25 AM
changing formulas to their result values eejitrecords Excel Discussion (Misc queries) 1 August 19th 08 02:17 PM
Changing cell values between columns with macro spolk Excel Programming 1 February 18th 04 12:48 PM


All times are GMT +1. The time now is 05:28 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"