Home |
Search |
Today's Posts |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Luke
Just an add-on to your advice about disabling/enabling events. In order to reset events in case of an error you should trap for an error. On Error Goto stoppit Application.EnableEvents = False code to run stoppit: Application.EnableEvents = True End Sub Gord Dibben MS Excel MVP On Wed, 30 Sep 2009 08:15:02 -0700, Luke M wrote: Since your Change Event macro "changes" the sheet, you need to temporarily disable events to prevent an endless loop. Note that the EnableEvents does not automatically get reset to "true" at the end of a macro, so you want to make sure that is always included at the end. Private Sub Worksheet_Change(ByVal Target As Range) Application.EnableEvents = False With Range("H6") If Range("G6") <= 0.1 Then .Value = "l" .Font.Name = "Wingdings" .Font.Color = RGB(0, 0, 255) ElseIf Range("G6") <= 0.2 Then .Value = "?" .Font.Name = "Wingdings 3" .Font.Color = RGB(255, 192, 0) ElseIf Range("G6") 0.2 Then .Value = "" .Font.Name = "Wingdings" .Font.Color = RGB(255, 0, 0) End If End With Application.EnableEvents = True End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Changing font style/size/color/etc for multiple series in a chart? | Charts and Charting in Excel | |||
Font color changing by itself | Excel Discussion (Misc queries) | |||
Changing Font color based on font type or size | Excel Discussion (Misc queries) | |||
Changing Font Color | Excel Discussion (Misc queries) | |||
changing font style in a complex worksheet function | Excel Worksheet Functions |