Using InStr with variables

W

wthomas206

How do I use the InStr function with variables?
Dim intStart as integer
Dim strSearch as string
Dim strSought as string

strSearch = Range("E2").Value 'Cell value is PO Box 111 LAKEBAYWA 98349
strSought = Range("F2").Value 'Cell value is LAKEBAY

intStart = InStr(intSearch, strSought) ' intStart returns 0
 

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

replace string 3
Trying to loop 3
Get PST file path string 8
Switching between worksheets 2
Seaching an excel sheet 1
Change from Text to Value 1
Array coding type mismatch 6
Type Mismatch 0

Top