View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Barb Reinhardt Barb Reinhardt is offline
external usenet poster
 
Posts: 3,355
Default Using InStr with variables

Um ... you haven't defined intSearch

"wthomas206" wrote:

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