Hi All,
New to this forum but im hoping you can help, as I'm struggling to get this task done at work.
I've got a conditional formatting macro for my worksheet as I have more than 3 conditions.
But now I need to use information from another worksheet (in the same workbook) in the macro.
Basically I dont know how to reference the new worksheet.
This is what I Currently have:
Private Sub Worksheet_Change(ByVal Target As Range)
Set MyPlage = Range("D5:D69")
For Each Cell In MyPlage
If Cell.Value = "8601" Then
Cell.Interior.ColorIndex = 41
End If
If Cell.Value = "8501" Then
Cell.Interior.ColorIndex = 43
End If
If Cell.Value = "4901" Then
Cell.Interior.ColorIndex = 46
End If
If Cell.Value = "4902" Then
Cell.Interior.ColorIndex = 44
End If
If Cell.Value = "3802" Then
Cell.Interior.ColorIndex = 47
End If
If Cell.Value = "3802(D)" Then
Cell.Interior.ColorIndex = 7
End If
If Cell.Value = "8504" Then
Cell.Interior.ColorIndex = 18
End If
If Cell.Value = "Not listed" Then
Cell.Interior.ColorIndex = 15
End If
Next
End Sub
Thanks in advance!
Chris A
New to this forum but im hoping you can help, as I'm struggling to get this task done at work.
I've got a conditional formatting macro for my worksheet as I have more than 3 conditions.
But now I need to use information from another worksheet (in the same workbook) in the macro.
Basically I dont know how to reference the new worksheet.
This is what I Currently have:
Private Sub Worksheet_Change(ByVal Target As Range)
Set MyPlage = Range("D5:D69")
For Each Cell In MyPlage
If Cell.Value = "8601" Then
Cell.Interior.ColorIndex = 41
End If
If Cell.Value = "8501" Then
Cell.Interior.ColorIndex = 43
End If
If Cell.Value = "4901" Then
Cell.Interior.ColorIndex = 46
End If
If Cell.Value = "4902" Then
Cell.Interior.ColorIndex = 44
End If
If Cell.Value = "3802" Then
Cell.Interior.ColorIndex = 47
End If
If Cell.Value = "3802(D)" Then
Cell.Interior.ColorIndex = 7
End If
If Cell.Value = "8504" Then
Cell.Interior.ColorIndex = 18
End If
If Cell.Value = "Not listed" Then
Cell.Interior.ColorIndex = 15
End If
Next
End Sub
Thanks in advance!
Chris A