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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Function/Code to set bold in a cell

Status
Not open for further replies.

risoam

MIS
Apr 17, 2002
33
US
Hi. I am trying to set the contents of a cell to bold, if the contents of a different cell = xxxx. I know how to use the if statment, but is there any code where I can set the properties of a cell to bold like that? or even to change the font color or cell background, anything?

Thanks.
 
Try this

ActiveCell.Interior.ColorIndex = 28

this will change the active cell to a cyan fill. You can also change the ActiveCell to a variable.

Regards,

Dave
 
Sorry, you asked for Bold, try this

ActiveCell.Font.Bold = True


Regards,

Dave
 
Hi risoam

Have you considered using Conditional Formatting as this will do away with the need for code (provided you have no more than three 'conditions' to test)

;-) If a man says something and there are no women there to hear him, is he still wrong?
"...Three Lions On A Shirt..."
 
risoam,

Psssssssst. Because you've posted 12 threads and have yet to issue any of those "STARS", you're probably not yet aware of this "accepted practice" of showing appreciation to contributors at Tek-Tips.

The creators of Tek-Tips set up this process of awarding of STARS - just like in early school years - as the "proper" way of "saying Thanks" and giving recognition for the time a contributor takes to develop a solution or provide a tip.

Issuing a STAR is simply a matter of clicking on the "Click here to mark this post as a helpful or expert post!" - located in the lower-left-corner of the contributor's posting.

Please do NOT issue a star for my posting, as it's only a "reminder". I want to "earn" stars in the normal manner. Thanks. :)

Incidentally, I believe Loomah is on the right track with his suggestion of Conditional Formatting. If you encounter any difficulty, let us know and one of us can provide a "specific" example.

Regards, ...Dale Watson dwatson@bsi.gov.mb.ca

 
risoam,

P.S...

You should also go into your "Personal Profile" - top-left-corner - and change your "NotifyMe" options, so that you'll be notified via email whenever anyone posts a response.

This is ALSO a nice way to keep track of your postings, because it marks your postings with a BIG RED CHECK-MARK.

In additon, whenever you want to reference your past postings, you can easily list all of them together by clicking on the "check-mark" under "Thread Order".

Regards, ...Dale Watson dwatson@bsi.gov.mb.ca
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top