Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 63
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,090
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 63
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
When I change the font size in a cell the value changes. Value increases with increase in font. Excel Worksheet Functions 5 June 28th 07 11:00 PM
How to change Font size based upon cell input Ashley McKay Excel Discussion (Misc queries) 5 March 23rd 07 06:44 PM
Change all text one font size up with various font sizes used. omchrystal New Users to Excel 2 March 6th 07 09:01 PM
Cell value specific font size change Geoff C Excel Programming 7 February 6th 06 09:10 AM
change font size and bold in cell? R Doornbosch Excel Programming 7 February 10th 04 12:03 AM


All times are GMT +1. The time now is 08:31 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"