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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Excel 2003 - can I tell if a cell contains a formula?

Status
Not open for further replies.

dgillz

Instructor
Mar 2, 2001
10,045
US
I need to be able to test if a cell contains a formula or a static value. Is there a way to do this in VBA?

If cells(1,1).isFormula then
Do This
else
Do That
End if

Any insights appreciated.

Software Sales, Training, Implementation and Support for Macola, Synergy, and Crystal Reports. Check out our Macola tools:
 
Answered my own question. Its the .HasFormula property.

If cells(1,1).HasFormula then
Do This
else
Do That
End if

Software Sales, Training, Implementation and Support for Macola, Synergy, and Crystal Reports. Check out our Macola tools:
 
myRange.SpecialCells(xlCellTypeFormulas, 23)
A bit more to it - look up the Specialcells method in help

Gavin
 
What are you planning on doing to Formulas that you aren't doing to other cells?

[tt][blue]-John[/blue][/tt]
[tab][red]The plural of anecdote is not data[/red]

Help us help you. Please read FAQ 181-2886 before posting.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top