-
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
-
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!