![]() |
Getting r/t 13 - Type Mismatch on this line - Why?
If ActiveSheet.UsedRange.SpecialCells(-4144) Then
|
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 |
Getting r/t 13 - Type Mismatch on this line - Why?
appreciate the 3 (important) pointers!!
"Bob Phillips" wrote: 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 |
All times are GMT +1. The time now is 10:44 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com