Type Mismatch

  • Thread starter Thread starter Raman325
  • Start date Start date
R

Raman325

For some reason, I'm having a bit of a problem with this bit of code and
I can't figure out why:


Code:
--------------------
Set rngFindRange = baseBook.ActiveSheet.Range("H" & basePos, "BE500")
Set rngFoundCell = rngFindRange.Find(Selection.Value, "H" & basePos, xlValues, xlWhole, xlByRows, xlNext)
--------------------


I keep getting a type mismatch with that but I can't figure out why.
baseBook is a valid Workbook and basePos is a valid Long. Can anyone
help? Thanks in advance.
 
Hi Raman,

You have specified a string for the parameter 'After' for the 'Find'
function.
The following should work.

Set rngFoundCell = rngFindRange.Find(Selection.Va­lue,
rngFindRange.Cells(1,1), xlValues, xlWhole, xlByRows, xlNext)

Regards,
Jayant
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

type mismatch on find function 7
Worksheet_Change Woes 6
Not getting "argument type mismatch" 4
Loop through Variables 4
find location 12
Type mismatch 4
Type Mismatch error 3
Overflow error 3

Back
Top