Results 1 to 2 of 2

Thread: A Quickie!!

  1. #1

    Thread Starter
    Addicted Member icemanmt78's Avatar
    Join Date
    May 2000
    Posts
    142

    Angry

    I am trying to find the first instance of the " character in s string using the Instr function. How do i enclose the ". At the moment i am doing the following

    mark = instr(1,test,""",vbtextcompare)

    This doesn't work and VBA tells me the line is syntactically incorrect.

    Any ideas

  2. #2
    I'm about to be a PowerPoster! Joacim Andersson's Avatar
    Join Date
    Jan 1999
    Location
    Sweden
    Posts
    14,649
    You can use two quotes like this "" but since you have to put qutoes around a string you actually need four: """"
    Code:
    mark = InStr(1, test, """", vbTextCompare)
    You could also use the chr() function and pass the ascii value (34):
    Code:
    mark = InStr(1, test, Chr(34), vbTextCompare)
    Good luck!


Posting Permissions

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



Click Here to Expand Forum to Full Width