Using InStr with variables

  • Thread starter Thread starter wthomas206
  • Start date Start date
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

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

Back
Top