Instr Function

Results 1 to 2 of 2

Thread: Instr Function

  1. #1
    Join Date
    Dec 1969

    Default Instr Function

    I know I can specify a starting position with the Instr function, but is there also a way to specify an ending position? In the example below say I only wanted to search the first 6 characters instead of the entire string for the character "W". Thanks. <BR><BR>SearchString ="Apples, Pears, Waffles"<BR>MyPos = Instr(1, SearchString, "W")

  2. #2
    Join Date
    Dec 1969

    Default RE: Instr Function

    Not with Instr alone, but you could do something like this:<BR><BR>SearchString ="Apples, Pears, Waffles"<BR>MyPos = Instr(1, Left(SearchString, 6), "W")

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts