+ Reply to Thread
Results 1 to 5 of 5

How to Search and Replace words Double Quotes

  1. #1
    Forum Contributor
    Join Date
    11-29-2012
    Location
    Coimbatore, India
    MS-Off Ver
    Excel 2010
    Posts
    101

    How to Search and Replace words Double Quotes

    Hi Evryone,

    I have a unique problem. May be it sounds silly. I'm invoking a search from Excel Macro into a word document. For example if i want to search a word Mobile Phone then i will use the following command.
    With rng.Find
    .ClearFormatting
    .Replacement.ClearFormatting
    .Replacement.Font.Bold = True
    .Text = "Mobile Phone"
    End With

    But what if i want to search a word "Mobile Phone". Please note the double quotes. How to handle this.

  2. #2
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: How to Search and Replace words Double Quotes

    If you want to include quotes in the string you have to double them up:

    Please Login or Register  to view this content.
    Personally I always find this too confusing and just use the ASCI code for quotes instead:

    Please Login or Register  to view this content.

  3. #3
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,376

    Re: How to Search and Replace words Double Quotes

    Try:

    Please Login or Register  to view this content.

    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  4. #4
    Forum Contributor
    Join Date
    11-29-2012
    Location
    Coimbatore, India
    MS-Off Ver
    Excel 2010
    Posts
    101

    Re: How to Search and Replace words Double Quotes

    Thank you all..

    .Text = """Mobile Phone""" worked for me. Thanks again

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    44,376

    Re: How to Search and Replace words Double Quotes

    You're welcome. Thanks for the rep.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1