How do I identify if a cell in excel contains a formula or a numbe

G

Guest

I would like to identify some how if a cell contains just a written number
(ex "25000") or contains a formula.
I would like to do this because I have an array where some cell contains
formulas but some are numbers and I would like to be able to use conditional
formating to highlight the cells that just have a number.

Regards
/Tobias
 
I

IC

Click on the cell and look at the formula bar. The formula or the value will
appear there.

Ian
 
B

Bob Phillips

Tobias,

Create a UDF like so

Function IsFormula(rng As Range)
If rng.Count > 1 Then
IsFormula = CVErr(xlErrRef)
Else
If rng.HasFormula Then
IsFormula = True
End If
End If
End Function

Then select the cells, and got to Format>Conditional Formatting, select a
condition of Formula Is, add a formula of =IsFormula(A1) (assuming your
start cell is A1, and select a pattern to show.
 
G

Gord Dibben

Tobias

Select your array.

Edit>Go To>Special>Constants. Uncheck all boxes except "number".

OK your way out.

With these selected cells give them a color.

Gord Dibben Excel MVP



On Mon, 27 Sep 2004 10:41:08 -0700, "Tobias Andersson" <Tobias
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top