Does a cell contain a formula or a value?

S

scout29c

Is there a function or a group of nested functions I can enter that tells me
that a cell on the same row contains a formula or a value. Actuall I want to
know if it contains a formula. A value is OK.

The user (usually me) is supposed to convert the column of formulas to
values before continuing. I have had to go back and redo this so many times
because I forgot to make the change before continuing. This is a often
repeaded task and the column always has a different row count, but it's
always the same column.

I know I could write a function macro or use conditional foramting to color
the cell, but I was wanting something that returned Ture or False which I
would convert to 0 or 1 and which I would sum and if it is >0 a message would
show at the top.
 
L

Luke M

Not quite what you asked, but you if you select any area(s) and press Ctrl+G,
click Special, then formulas, Excel will select all cells within your initial
selection that contain formulas.

If no formulas, its will tell you no cells were found.
 
G

Gary''s Student

The user defined function:

Function formulaa(r As Range) As Integer
formulaa = 0
If r.HasFormula Then formulaa = 1
End Function

will return a 1 if the cell has a formula in it.
 
R

Rick Rothstein

You can convert all the formulas to values and leave all the values as they
are by right clicking the tab for the worksheet you want to do this on,
select View Code from the pop up window (we do this because we need that
worksheet to be the active sheet) and then execute this statement in the
Immediate window..

Cells.Value = Cells.Value

I know it looks funny to assign the same thing to itself, but trust me, it
works.
 

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