Determining if cell contains formula or value

  • Thread starter Thread starter tapeery
  • Start date Start date
T

tapeery

I have a cell that contains a formula, but users can override it b
entering a value, if necessary.

I need to determine whether the cell contains a formula, or if th
formula has been overwritten by a value.

How would I do this?

Alternately, is there any way to extract the formula from a cell, an
treat the formula a text?

Thanks for any thoughts
 
Hi
you may try the following UDF (put in a module of your workbook)

Function is_formula(rng As Range)
is_formula = rng.HasFormula
End Function

use it like
=IS_FORMULA(A1)

Note: not much error checking included (e.g. multiple cells as range
parameter, array formulas, etc.).
 

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

Back
Top