Results 1 to 4 of 4
  1. #1
    JustCallMeAl
    Guest

    InStr Failing (VBA/Word97 SR2)

    For some reason, this line produces a message box displaying "0"

    <pre>MsgBox InStr("MSFT", "aaaa MSFT aaaa")</pre>


    Now getting the message box is not the issue. Why is InStr failing here?

  2. #2
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: InStr Failing (VBA/Word97 SR2)

    Because you're searching for "aaaa MSFT aaaa" in "MSFT"?
    Regards,
    Rory

    Microsoft MVP - Excel

  3. #3
    JustCallMeAl
    Guest

    Re: InStr Failing (VBA/Word97 SR2)

    The sound you are hearing is me putting my head through the wall! <img src=/S/bash.gif border=0 alt=bash width=35 height=39>

    Oh, how silly of a mistake!

    Thanks.

    Imagine that. It works!

    And, yes I did read the helps, over and over and over and over and.....

  4. #4
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: InStr Failing (VBA/Word97 SR2)

    It's a sound I'm all too familiar with on my part! (there's a smilie for it in Pix place somewhere which we could do with!)
    Regards,
    Rory

    Microsoft MVP - Excel

Posting Permissions

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