Thread: empty range?
View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
sali sali is offline
external usenet poster
 
Posts: 53
Default empty range?

"Ryan H" je napisao u poruci interesnoj
...
I'm not sure if you can do it with the Count Function but here are two
ways
you can make your code work without an error being thrown and without
using
On Error Goto statements.

If IsNull(Sheets("Sheet1").Cells.HasFormula) Or
Sheets("Sheet1").Cells.HasFormula Then

just as little surprise, method specialcells(xlCellTypeFormulas) had to
return "empty" range since there were no formulas, but instead of having
..cells.count=0, or to skip loop in "for each", it thrown error "no cells
in


thnx, "hasformula" property is new for me, i haven't noticed it befor. it
may help.
before, i used to check existence of cell's formula with "formula" property,
like:

if left(.formula,1)="=" then
....

but, anyway, it is still surprise not having count=0 for empty range

[thnx for the answer, but i have no "yes" to click in my newsreader client]