Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel / VBA - how to bold a cell's number

Status
Not open for further replies.

wrbodine

Programmer
Aug 24, 2000
302
US
I want to make a numeric value in a cell bold if its over a certain value.

I tried setting the bold property in the following 2 ways, with no success:
1. Range("AE4").Select
ActiveCell.Font.Bold = True

2. Range("AE4").Font.Bold = True

Any ideas for how to do this??
Thanks,
Ray
 

Give this a shot.

Sub Macro1()
Range("G15").Select
Selection.Font.Bold = True
End Sub
QUOTE OF THE DAY
Don't waste time telling people what you are doing or what you are going to do. Results have a way of informing the world.

<%
Jr Clown :eek:)
%>
 
JrClown's code is correct maybe it's the condition statement that is formatted incorrectly so that it doesn't give expected results. What is your statement that tests if the cell's value is greater than a certain number?

JC
 
If ActiveCell.Value > 0 Then
Selection.Font.Bold = True
End If

I tried it outside of the condition also, just like the 2 lines of JrClown's code, before and after putting the numeric value in....
 
Try:
Range(&quot;C5&quot;).Select
If Selection > 0 Then
Selection.Font.Bold = True
End If

You could also select all the cells you wanted to apply the formating to and then click on Conditonal Formating under the Format menu item and then create your conditon.

HTH,
JC
 
Its working now... For some reason I had to step through the code, and after debugging it that way the correct results came out. Thanks, Ray
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top