×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

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

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

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

(OP)
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

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


  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
%>

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

(OP)
that didn't work either.... Thanx though

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

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

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

(OP)
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....

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

Try:
 Range("C5").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

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

(OP)
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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close