Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to search string containing quotation marks?

Status
Not open for further replies.

osx99

Technical User
Apr 9, 2003
250
GB
I need to perform a search for the following string within a dump of some HTML code

<td align="center"><SCRIPT type="text/javascript"><!--

I've tried to use the folowing code to implement this
Code:
Range("a:a").Select
Set tipsdata = Selection.Find(What:="<td align="center"><SCRIPT type="text/javascript"><!--", after:=ActiveCell, LookIn:=xlFormulas, LookAt _
        :=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, MatchCase:= _
        False, SearchFormat:=False)

However, because the search string contains quotation marks " the code syntax is not being recognised

Is there a easy way around this?

Thanks,
Os
 
Yes, use double double-quotes within your search criteria to indicate a literal quote.
So your string would look something like this (untested):
Code:
Set tipsdata = Selection.Find(What:="<td align=""center""><SCRIPT type=""text/javascript""><!--"
You can also drop the quotes in some cases and it would work, so test either way.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top