+ Reply to Thread
Results 1 to 6 of 6

Using find replace to first find two double quotes and replace with a single double quote

  1. #1
    Forum Contributor
    Join Date
    12-01-2007
    Location
    USA-North Carolina
    MS-Off Ver
    MS Office 2016
    Posts
    2,662

    Using find replace to first find two double quotes and replace with a single double quote

    lets say i have a string like this

    string = "david,a1, a2, ""a3,a4,a5,a6"",a7,a8"

    i want to replace the two double quotes with a single quote like this

    string = "david,a1, a2, "a3,a4,a5,a6",a7,a8"

    any idea on how to do this in vba.......for some reason i cant figure it out

  2. #2
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,613

    Re: Using find replace to first find two double quotes and replace with a single double q

    You need extra double quotes
    try this to see hoe it works:
    Please Login or Register  to view this content.
    Best Regards,

    Kaper

  3. #3
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,613

    Re: Using find replace to first find two double quotes and replace with a single double q

    Or witch ascii code:
    Please Login or Register  to view this content.

  4. #4
    Valued Forum Contributor Kamboj's Avatar
    Join Date
    09-25-2014
    Location
    India
    MS-Off Ver
    2003 - 2010
    Posts
    430

    Re: Using find replace to first find two double quotes and replace with a single double q

    Please Login or Register  to view this content.

  5. #5
    Forum Contributor
    Join Date
    12-01-2007
    Location
    USA-North Carolina
    MS-Off Ver
    MS Office 2016
    Posts
    2,662

    Re: Using find replace to first find two double quotes and replace with a single double q

    yep that was it..........


    i have never understood how many quotes to put to get two quotes together.......is there some logic to it?

  6. #6
    Forum Guru Kaper's Avatar
    Join Date
    12-14-2013
    Location
    Warsaw, Poland
    MS-Off Ver
    most often: Office 365 in Windows environment
    Posts
    8,613

    Re: Using find replace to first find two double quotes and replace with a single double q

    basically - during assignment two outer (first and last) enclose whole string and then in the string each doublequote is represented by two
    singledoublequotestring = """" when you print, msgbox etc -> "

    doubledoublequotestring = """""" -> ""

    tripledoublequotestring = """""""" -> """
    etc.
    Last edited by Kaper; 06-17-2015 at 10:17 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] How to find and replace hidden single quote ? (This sign is single quote: ')
    By HerryMarkowitz in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-19-2014, 03:48 PM
  2. [SOLVED] How to Search and Replace words Double Quotes
    By sugaprasad in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 02-18-2013, 06:20 AM
  3. [SOLVED] How to Search and Replace words Double Quotes
    By sugaprasad in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-18-2013, 05:16 AM
  4. Replace double quotes with macro
    By Odeen in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-15-2013, 05:07 AM
  5. Replace Macro for Excel - HTML with Double Quotes Issue
    By errr in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-29-2012, 12:04 PM

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