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

Format a cell with a formula in it.

Status
Not open for further replies.

creeker69

Technical User
Jul 4, 2003
33
US
Here's what I have in a cell. The cell is right justified so that it will print since the adjacent cells to the left are empty. I need just the value to print in bold.

The cell formula is ="Total number of units > 45 days old is " & SUM(D6:D19) .

The value of D6:D19 happens to be 20.

I want JUST the "20" to appear in bold. Any way to do this? As soon as the "=" sign is entered into a cell, the format buttons go gray and will not work.
 
creeker69,

Can't do it with worksheet functions.

Can do it with VBA code.

Skip,

Want to get great answers to your Tek-Tips questions? Have a look at faq222-2244
 
The only way to do this with a formula is to re-structure the worksheet and use two cells:

Put Total number of units > 45 days old is in one cell
Put =SUM(D6:D19) in the cell to the right and make it bold.

Otherwise, as Skip indicated, you can use VBA to put pure text in the cell and selectively highligt the characters you want. But of course, you lose the dynamic action of the formula. You would have to process the worksheet change event for the cells in D6:D19 to continually update the text.
 
Thanks guys!

I hate hearing I can't but I kinda thought as much. Thanks for the help.

Ron
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top