G
Guest
I have formulas in several non-contiguous cells to return characters. I need the font of the character and the cell fill color to change based on the character. I used the following change event for another worksheet. It works well as the characters are typed or the results of a formula from the same sheet. But is not working for this application. Conditional formatting is working for the fill color, but is it more efficient to incorporate it into this macro? Can the change macro be adapted to use the "if" results or would you assist with a new regular macro?
This could be solved so easily if font type was an option in conditional formatting.
The cells that I need changed are B16, B58, T4, T15,T34,T50.
c=light green fill, Wingdings 3 font
ê=yellow fill, Webdings font
y=red fill, Webdings font
sample formula
=IF(anotherworkbookdata!$W$158<=0.6,"y",IF(anotherworkbookdata!$W$158<=0.8,"ê","c"))
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("B16:B16")) Is Nothing Or Target.Cells.Count > 1 Then Exit Sub
If Target.Value = "c" Then
Application.EnableEvents = False
Target.Font.Name = "Wingdings 3"
Application.EnableEvents = True
Else
Application.EnableEvents = False
Target.Font.Name = "Webdings"
Application.EnableEvents = True
End If
End Sub
Thanks so much for your assistance.
Jodi
This could be solved so easily if font type was an option in conditional formatting.
The cells that I need changed are B16, B58, T4, T15,T34,T50.
c=light green fill, Wingdings 3 font
ê=yellow fill, Webdings font
y=red fill, Webdings font
sample formula
=IF(anotherworkbookdata!$W$158<=0.6,"y",IF(anotherworkbookdata!$W$158<=0.8,"ê","c"))
Private Sub Worksheet_Change(ByVal Target As Range)
If Intersect(Target, Range("B16:B16")) Is Nothing Or Target.Cells.Count > 1 Then Exit Sub
If Target.Value = "c" Then
Application.EnableEvents = False
Target.Font.Name = "Wingdings 3"
Application.EnableEvents = True
Else
Application.EnableEvents = False
Target.Font.Name = "Webdings"
Application.EnableEvents = True
End If
End Sub
Thanks so much for your assistance.
Jodi