Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Change size of font if cell value is greater than 0
I would like to change the size of font in a merged cell when the
value of a different cell is greater than 0. For example, if A10, then the font in B1 (merged cells B1:D1) will change from a default of 8 to 12, and revert back to 8 when A1=0. Are there any suggestions for a macro. Thanks in advance. Michael |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Change size of font if cell value is greater than 0
This little macro will do that. This is a sheet event macro and must be
placed in the sheet module of the sheet in question. As written, it will change the font size of B1 to 12 if A1 is greater than 0, and it will change it to 8 if A1 is anything else. HTH Otto Private Sub Worksheet_Change(ByVal Target As Range) If Target.Count 1 Then Exit Sub If Target.Value = "" Then Exit Sub If Not Intersect(Target, Range("A1")) Is Nothing Then If Range("A1").Value 0 Then Range("B1").Font.Size = 12 Else Range("B1").Font.Size = 8 End If End If End Sub wrote in message oups.com... I would like to change the size of font in a merged cell when the value of a different cell is greater than 0. For example, if A10, then the font in B1 (merged cells B1:D1) will change from a default of 8 to 12, and revert back to 8 when A1=0. Are there any suggestions for a macro. Thanks in advance. Michael |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Change size of font if cell value is greater than 0
Thanks Otto. You've been a great help.
Michael |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
When I change the font size in a cell the value changes. | Excel Worksheet Functions | |||
How to change Font size based upon cell input | Excel Discussion (Misc queries) | |||
Change all text one font size up with various font sizes used. | New Users to Excel | |||
Cell value specific font size change | Excel Programming | |||
change font size and bold in cell? | Excel Programming |