Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 468
Default Getting r/t 13 - Type Mismatch on this line - Why?

If ActiveSheet.UsedRange.SpecialCells(-4144) Then
  #2   Report Post  
Posted to microsoft.public.excel.programming
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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 468
Default 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




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
type mismatch vsoler Excel Programming 5 June 10th 07 04:47 PM
Type Mismatch: array or user defined type expected ExcelMonkey Excel Programming 4 July 6th 06 03:40 PM
Type mismatch using rnge as Range with Type 8 Input Box STEVE BELL Excel Programming 11 December 3rd 05 05:02 AM
Help: Compile error: type mismatch: array or user defined type expected lvcha.gouqizi Excel Programming 1 October 31st 05 08:20 PM


All times are GMT +1. The time now is 08:05 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"