View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 6,953
Default Runtime Error 13 Type Mismatch

I would expect version B to work, but try changing

Columns("A:A") to Columns(1)

--
Regards,
Tom Ogilvy


"Arturo" wrote:

Im testing If rngFound Is Nothing.
(A) searches too broadly where Im needing to only look in column A. (B)
generates a type mismatch 13. Every type Ive assigned to rngFound results
in an error Im not resolveing€¦

(A)
Dim rngFound As Range
Set rngFound = Cells.Find(What:=Y_CellBase, _
After:=ActiveCell, _
LookIn:=xlFormulas, _
LookAt:=xlPart, _
SearchOrder:=xlByColumns, _
SearchDirection:=xlNext, _
MatchCase:=False, _
SearchFormat:=False)

(B)
Dim rngFound As Range
Set rngFound = Columns("A:A").Find(What:=Y_CellBase, _
After:=ActiveCell, _
LookIn:=xlFormulas, _
LookAt:=xlPart, _
SearchOrder:=xlByColumns, _
SearchDirection:=xlNext, _
MatchCase:=False, _
SearchFormat:=False)

Appreciatively,
Arturo