View Single Post
  #10   Report Post  
Posted to microsoft.public.excel.programming
Alok Alok is offline
external usenet poster
 
Posts: 318
Default Run-Time error '1004': No cells were found

I agree with you Dave that in this case both constants happen to have the
same value but using the other defeats the purpose of using incorrect
constant defeats the purpose and makes the code even more difficult to
maintain than using say the value of 2.

"Dave Peterson" wrote:

From the immediate window in xl2003's VBE:

?xlConstants
2

?xlcelltypeConstants
2

But I don't think that's the problem, either.

Alok wrote:

Hi JLGWhiz,
There is no Enumerated value of xlConstants in the XlCellType enumeration.
Hence that is unlikely to be the problem.
Alok

"JLGWhiz" wrote:

Maybe you want to use just xlConstants instead of xlCellTypeConstants.

"Regina" wrote:

The subject line is the error message I get when trying to run the following
code. When I hit debug, it highlights the line that starts with "set r -
range...". What I am trying to do is clear the constants but leave the
formulas in the "D7:E125" Range. Help!!!!

' Sub clear_part2()
Dim r As Range
Set r = Range("D7:E125").SpecialCells(xlCellTypeConstants)
r.Clear

End Sub
--
Regina


--

Dave Peterson