View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_3_] Bob Phillips[_3_] is offline
external usenet poster
 
Posts: 2,420
Default Getting r/t 13 - Type Mismatch on this line - Why?

You need to cater for none being found, and test for Nothing not True. And
best to use the builtin constant, not its value

Dim rng As Range

On Error Resume Next
Set rng = ActiveSheet.UsedRange.SpecialCells(xlCellTypeComme nts)
On Error GoTo 0
If Not rng Is Nothing Then

MsgBox "comments"
End If


--
__________________________________
HTH

Bob

"JMay" wrote in message
...
If ActiveSheet.UsedRange.SpecialCells(-4144) Then