Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,355
Default Using InStr with variables

FWIW, if you'd put Option Explicit before your code, you would have known
that you didn't have intSearch declared as well.

"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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Instr Karen53 Excel Programming 3 April 2nd 08 01:33 AM
instr() ? mark kubicki Excel Programming 3 November 16th 06 05:07 PM
InStr Harley Excel Programming 3 August 9th 05 08:55 PM
InStr FGM Excel Programming 3 July 14th 05 08:47 PM
InStr and ADO Al Excel Programming 2 June 17th 04 04:22 PM


All times are GMT +1. The time now is 10:41 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"