I have the following code, which SET 1 Columns H:K respond to Columns F:G. SET 2 Columns N:Q respond to Columns L:M. Set 3 Columns T:W respond to Columns R:S. Now following that same logic I want the final column in each set to respond if F, L, or R are True or F&G, L&M, R,S are True then the final column in the set should remain blank and color fill white, but the last column should G,M,or S be True in any of the sets should calulate the first column (H,N,T) + 2nd to Last column (J,P,V) For example if G is True then H+J should show in K. Now also if using this example if '=IF(K >= AB1, TRUE, FALSE)' text in green, if 'K < AB1, TRUE, FALSE' text should show in Red and if '=AND(A40=TRUE, F=TRUE)' then text should be italic.
I need another Private Sub I believe but this is the current base that should stay mostly the same:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim ws As Worksheet
Set ws = ThisWorkbook.Worksheets("Tracker")
'Build range all at once by intersecting whole columns and rows
Dim rng As Range 'Specify columns 'Specify rows
Set rng = Intersect(ws.Range("F:G, L:M, R:S"), ws.Range("12:29, 35:79, 86:102, 110:150"))
'Identify total changed cells
Dim rChanged As Range: Set rChanged = Intersect(Target, rng)
'Prepare loop vars
Dim rChangedCell As Range, rArea As Range
Dim rCell1 As Range, rCell2 As Range
If Not rChanged Is Nothing Then
Application.EnableEvents = False
For Each rChangedCell In rChanged.Cells
For Each rArea In rng.Areas
Set rCell1 = Intersect(rArea, rChangedCell)
If Not rCell1 Is Nothing Then
If rCell1.Column <> rArea.Column Then Set rCell1 = ws.Cells(rCell1.Row, rArea.Column)
Exit For
End If
Next rArea
Set rCell2 = rCell1.Offset(, 1)
Call UpdateLine(rCell1, rCell2)
Next rChangedCell
Application.EnableEvents = True
End If
End Sub
Private Sub UpdateLine(ByVal p_rCell1 As Range, ByVal p_rCell2 As Range)
Dim aResult As Variant
Select Case (Abs(p_rCell1.Value = True) + Abs(p_rCell2.Value = True) * 2)
'0 means both cells are False
Case 0: aResult = Array(False, False, vbNullString, vbNullString)
'1 means p_rCell1 is True
Case 1: aResult = Array(True, False, Date, "No")
'Otherwise p_rCell2 is True
Case Else: aResult = Array(False, True, Date, "Yes")
End Select
p_rCell1.Resize(, UBound(aResult) - LBound(aResult) + 1).Value = aResult
End Sub
=IF(K >= AB1, TRUE, FALSE)do you mean TRUE in green, FALSE in red.=AND(A40=TRUE, F=TRUE)? what isF