Thread: InStr Question
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Die_Another_Day Die_Another_Day is offline
external usenet poster
 
Posts: 644
Default InStr Question

InStr return the Absolute Position in the string, regardless of the
"Start position" the Start position just tells it to skip the first few
characters.

Charles

Norm Lundquist wrote:
Here's an easy one that I can't see!

Why does

InStr(4,"XXpXXpXXPXXP","P",vbTextCompare)

return 6 and

Instr(5,"ABC-123-XYZ","-",vbTextCompare)

return 8??? I thought the second one would return 4 because the second dash
is the fourth character when you start search at position 5.

THANKS!