View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
FSt1 FSt1 is offline
external usenet poster
 
Posts: 3,942
Default Change font size based on value of a cell

hi
sounds like conditional formating but unfortunately with conditional
fomating you can change the color, style, strick through and underline but
not font or font size so it looks like you're stuck with a macro.
you didn't say where your merged cells were so for test i merged B3 with B4.
change to suit.
Private Sub Worksheet_Change(ByVal Target As Range)
Set Target = Range("A1")
If Target 0 Then
Range("B3").Font.Size = 16
Else
Range("B3").Font.Size = 10
End If
End Sub

so each time the value of A1 changes, the font size will change accordingly.

this is worksheet code so right click the sheet tab, click view code then
paste the above in.

Regards
FSt1

" wrote:

If the value of A10, I need the font size in a merged cell to change
from the default 10 to 16. It needs to return to the default size
when A1 returns to a value of 0. Can someone help with this?
Thanks.

Michael