B Bob Phillips Nov 25, 2008 #2 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(xlCellTypeComments) On Error GoTo 0 If Not rng Is Nothing Then MsgBox "comments" End If
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(xlCellTypeComments) On Error GoTo 0 If Not rng Is Nothing Then MsgBox "comments" End If
J JMay Nov 25, 2008 #3 appreciate the 3 (important) pointers!! Bob Phillips said: 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(xlCellTypeComments) On Error GoTo 0 If Not rng Is Nothing Then MsgBox "comments" End If -- __________________________________ HTH Bob Click to expand...
appreciate the 3 (important) pointers!! Bob Phillips said: 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(xlCellTypeComments) On Error GoTo 0 If Not rng Is Nothing Then MsgBox "comments" End If -- __________________________________ HTH Bob Click to expand...