View Single Post
  #2   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

Regina,
Try this

Sub clear_part2()
Dim r As Range
On Error Resume Next
Set r = Range("D7:E125").SpecialCells(xlCellTypeConstants)
On Error GoTo 0
If Not r Is Nothing Then
r.Clear
End If
End Sub


"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