This is my working function,,,,,, but it only works for Sheet1 and I tryed to copy it to ThisWorkbook but it does not work for any other sheet. Do I realy need to copy it to all sheet and mainten all of them?
Thanks,
This group is excellence,
The Learning, Bruce.
'"Pass" in cell G row A:O Green.
'"Fail" in cell G row A:O Red
'"Pass" in cell G cell M is = "to {Major or Minor}" turn the row A:O Yellow.
Option Compare Text
Public Sub demo()
Letter = "P"
If Letter = "p" Then MsgBox "Case does not matter"
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
Dim WatchRange As Range
Dim cell As Range
Dim rng As Range
Set WatchRange = Columns("G")
Set WatchRangeM = Columns("M")
Dim myMultiAreaRange As Range
Set myMultiAreaRange = Union(WatchRange, WatchRangeM)
If Intersect(Target, myMultiAreaRange) Is Nothing Then Exit Sub
Set rng = Intersect(Target, myMultiAreaRange)
For Each cell In rng
With Range(Cells(cell.Row, "A"), Cells(cell.Row, "O")).Font
Select Case LCase(cell):
Case "Pass", "P"
If Cells(cell.Row, "M") = "Major" Or Cells(cell.Row, "M") = "Minor" Or Cells(cell.Row, "M") = "Maj" Or Cells(cell.Row, "M") = "Min" Then
.ColorIndex = 33
.Bold = True
Else
.ColorIndex = 10
.Bold = False
End If
Case "Major", "Maj", "Minor", "Min"
If Cells(cell.Row, "G") = "Pass" Or Cells(cell.Row, "G") = "P" Then
.ColorIndex = 33
.Bold = True
Else
.ColorIndex = 10
.Bold = False
End If
Case "Fail", "F"
.ColorIndex = 3
.Bold = False
Case Else
.ColorIndex = 1
.Bold = False
End Select:
End With
Next cell
End Sub
Thanks,
This group is excellence,
The Learning, Bruce.
'"Pass" in cell G row A:O Green.
'"Fail" in cell G row A:O Red
'"Pass" in cell G cell M is = "to {Major or Minor}" turn the row A:O Yellow.
Option Compare Text
Public Sub demo()
Letter = "P"
If Letter = "p" Then MsgBox "Case does not matter"
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
Dim WatchRange As Range
Dim cell As Range
Dim rng As Range
Set WatchRange = Columns("G")
Set WatchRangeM = Columns("M")
Dim myMultiAreaRange As Range
Set myMultiAreaRange = Union(WatchRange, WatchRangeM)
If Intersect(Target, myMultiAreaRange) Is Nothing Then Exit Sub
Set rng = Intersect(Target, myMultiAreaRange)
For Each cell In rng
With Range(Cells(cell.Row, "A"), Cells(cell.Row, "O")).Font
Select Case LCase(cell):
Case "Pass", "P"
If Cells(cell.Row, "M") = "Major" Or Cells(cell.Row, "M") = "Minor" Or Cells(cell.Row, "M") = "Maj" Or Cells(cell.Row, "M") = "Min" Then
.ColorIndex = 33
.Bold = True
Else
.ColorIndex = 10
.Bold = False
End If
Case "Major", "Maj", "Minor", "Min"
If Cells(cell.Row, "G") = "Pass" Or Cells(cell.Row, "G") = "P" Then
.ColorIndex = 33
.Bold = True
Else
.ColorIndex = 10
.Bold = False
End If
Case "Fail", "F"
.ColorIndex = 3
.Bold = False
Case Else
.ColorIndex = 1
.Bold = False
End Select:
End With
Next cell
End Sub