Ich versuche, die Farbe einer Reihe von Zellen ("A" zu "N") abhängig von dem Wert einer definierten Zelle zu ändern, in diesem Fall den Wert in Zelle "H". Ich muss für die Fälle "credentialing", "ci error/ticket" und "completed/backup" zu weiß und fett wechseln und die anderen Fälle behalten es in regulärem Schwarz.Ändern der Schriftfarbe in der bedingten Formatierung
Ich habe den Code zum Ändern der Zellfarbe auf dem definierten Bereich, aber ich weiß nicht, wie Sie den Code für die Schriftart und Farbe anwenden, um zu ändern. Hier ist, was ich bisher:
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Columns("H")) Is Nothing Then
On Error GoTo bm_Safe_Exit
Application.EnableEvents = False
Dim trgt As Range
For Each trgt In Intersect(Target, Columns("H"))
Select Case LCase(trgt.Value2)
Case "2 day process"
Cells(trgt.Row, "A").Resize(1, 14).Interior.ColorIndex = 46
Case "advisor"
Cells(trgt.Row, "A").Resize(1, 14).Interior.ColorIndex = 37
Case "back in"
Cells(trgt.Row, "A").Resize(1, 14).Interior.ColorIndex = 22
Case "ci error/ticket"
Cells(trgt.Row, "A").Resize(1, 14).Interior.ColorIndex = 1
Case "completed"
Cells(trgt.Row, "A").Resize(1, 14).Interior.ColorIndex = 10
Case "completed/backup"
Cells(trgt.Row, "A").Resize(1, 14).Interior.ColorIndex = 51
Case "credentialing"
Cells(trgt.Row, "A").Resize(1, 14).Interior.ColorIndex = 49
Case "credit"
Cells(trgt.Row, "A").Resize(1, 14).Interior.ColorIndex = 44
Case "duplicate"
Cells(trgt.Row, "A").Resize(1, 14).Interior.ColorIndex = 10
Case "held"
Cells(trgt.Row, "A").Resize(1, 14).Interior.ColorIndex = 37
Case "master data"
Cells(trgt.Row, "A").Resize(1, 14).Interior.ColorIndex = 37
Case "name change"
Cells(trgt.Row, "A").Resize(1, 14).Interior.ColorIndex = 37
Case "ofr"
Cells(trgt.Row, "A").Resize(1, 14).Interior.ColorIndex = 3
Case "op consultant"
Cells(trgt.Row, "A").Resize(1, 14).Interior.ColorIndex = 37
Case "post process"
Cells(trgt.Row, "A").Resize(1, 14).Interior.ColorIndex = 32
Case "pps"
Cells(trgt.Row, "A").Resize(1, 14).Interior.ColorIndex = 37
Case "react acct"
Cells(trgt.Row, "A").Resize(1, 14).Interior.ColorIndex = 37
Case "rejected"
Cells(trgt.Row, "A").Resize(1, 14).Interior.ColorIndex = 10
Case "transferred"
Cells(trgt.Row, "A").Resize(1, 14).Interior.ColorIndex = 10
Case "zpnd"
Cells(trgt.Row, "A").Resize(1, 14).Interior.ColorIndex = 37
Case Else
Cells(trgt.Row, "A").Resize(1, 14).Interior.Pattern = xlNone
End Select
Next trgt
End If
bm_Safe_Exit:
Application.EnableEvents = True
End Sub
https://msdn.microsoft.com/en-gb/library/office/ff838238.aspx & https://msdn.microsoft.com/en-gb/library/office/ ff196273.aspx sollte Ihnen helfen. –