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!

How to highlight Excel cells with calculations?

Status
Not open for further replies.

klm2klm2

Programmer
Dec 24, 2002
36
US
I'd like to be able to display Excel cells with calculations with different formatting than other cells. e.g. If the cell contents begin with the equal sign, let the displayed value be in blue instead of black. Is there a way to do this?

Thanks,
Kim
 


Only way I know...

1) paste this function into a MODULE in your workbook or in your Personal.xls
Code:
Function IsFormula(rng As Range) As Boolean
    
    If rng.Formula = CStr(rng.Value) Then
        IsFormula = False
    Else
        IsFormula = True
    End If
End Function
2) In COnditionalFormatting
[tt]
Formula is: =IsFormula(A1)
[/tt]
Substitute A1 for the the upper left-hand cell reference of the selection you are ConditionalFormatting.

Skip,
[sub]
[glasses] [red]Be advised:[/red]When Viscounts were guillotined just as they were disclosing where their jewels were hidden, it shows to go that you should...
Never hatchet your Counts before they chicken! [tongue][/sub]
 
You can used a defined name ( say CellHasFormula ) that contains an Excel 4 command like this:
=GET.CELL(48,INDIRECT("rc",FALSE))

and use the defined name in conditional formatting, with the formula being
=CellHasFormula




Cheers, Glenn.

Did you hear about the literalist show-jumper? He broke his nose jumping against the clock.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top