Is it a formula

G

Gizmo63

Quick question.

Is there a VBA command that tests the activecell to see if it contains a
formula as opposed to actual text or number?
I've found tests for errors, dates, numbers, text etc.
You can test for "=" as it tests the value of the cell.

Prob really simple but I'm baffled.

Cheers
Giz
 
R

Ron Rosenfeld

Quick question.

Is there a VBA command that tests the activecell to see if it contains a
formula as opposed to actual text or number?
I've found tests for errors, dates, numbers, text etc.
You can test for "=" as it tests the value of the cell.

Prob really simple but I'm baffled.

Cheers
Giz


Function HasFormula(cell)
HasFormula = cell.HasFormula
End Function



--ron
 
G

Gizmo63

Cheers Ron,
Sorted.
I was expecting an 'IS' test (ISDATE, ISERROR etc) not a 'HAS' test.
 
Top