PC Review


Reply
Thread Tools Rate Thread

Change size of font if cell value is greater than 0

 
 
mrlanier@hotmail.com
Guest
Posts: n/a
 
      31st Oct 2007
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 A1>0,
then the font in B1 (merged cells B11) 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

 
Reply With Quote
 
 
 
 
Otto Moehrbach
Guest
Posts: n/a
 
      31st Oct 2007
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
<(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>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 A1>0,
> then the font in B1 (merged cells B11) 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
>



 
Reply With Quote
 
mrlanier@hotmail.com
Guest
Posts: n/a
 
      1st Nov 2007
Thanks Otto. You've been a great help.

Michael

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Change font size based on value of a cell MichaelRLanier@gmail.com Microsoft Excel Programming 3 8th Apr 2009 09:11 PM
Change font size based on value of a cell MichaelRLanier@gmail.com Microsoft Excel Discussion 1 8th Apr 2009 06:25 PM
When I change the font size in a cell the value changes. =?Utf-8?B?VmFsdWUgaW5jcmVhc2VzIHdpdGggaW5jcmVhc2Ug Microsoft Excel Worksheet Functions 5 28th Jun 2007 11:00 PM
Cell value specific font size change =?Utf-8?B?R2VvZmYgQw==?= Microsoft Excel Programming 7 6th Feb 2006 09:10 AM
change font size and bold in cell? R Doornbosch Microsoft Excel Programming 7 10th Feb 2004 12:03 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:59 AM.