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

Excel formulae count 1

Status
Not open for further replies.

bez999

Programmer
Oct 3, 2003
99
0
0
GB
I have searched my books and the net to find out if there is a formulae collection in Excel.
I feel there must be but cannot find any info.

I have some code that performs a Selection.SpecialCells(xlCellTypeFormulas, 23).Select but if there are no formulae an error occurs. I have put an on error condition in place to avoid the problem but I think it would be cleaner if I could establish whether there are any formulae present before launching into my logic.

Any ideas would be welcome.

Thanks

Regards
Chris Bezant
 
There is nothing wrong with using error trapping for this

The only other way I can think of doing this would be to use the FIND method looking in formulae and checking for "=" but that may find things that have an "=" in the middle of some text so isn't particularly robust - personmally, I would use error trapping - that's what it is there for

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 



Hi,

Take a look at the HasFormula Property.

Skip,
[sub]
[glasses] [red][/red]
[tongue][/sub]
 
Skip - nice ! didn't know you could apply that to a range of cells ! star for you

Rgds, Geoff

We could learn a lot from crayons. Some are sharp, some are pretty and some are dull. Some have weird names and all are different colours but they all live in the same box.

Please read FAQ222-2244 before you ask a question
 
Thanks, Skip, that's perfect - exactly what I had in mind :eek:)

Regards
Chris Bezant
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top