Find and replace coma between double quotes

freuzo

New Member
Joined
Feb 19, 2022
Messages
3
Office Version
  1. 2013
Platform
  1. Windows
Hello everyone,
I have a column wich contain strings and some of them contain double quote and values between them.
I need to find and replace comas wich can appear inside the values wich are inside those double quotes by spaces.
like :
From
A1 = 314714,cashboard,data1,"data2,mark,done"
to
A1 = 314714,cashboard,data1,"data2 mark done"

Could be formula or VBA code.

Thanks in advance.
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.
Here is a UDF that you can try...
VBA Code:
Function CommaQuotes(ByVal S As String) As String
  Dim X As Long, Arr() As String
  Arr = Split(S, """")
  For X = 1 To UBound(Arr) Step 2
    Arr(X) = Replace(Arr(X), ",", " ")
  Next
  CommaQuotes = Join(Arr, """")
End Function
 
Upvote 0
Solution
Hi,

With formula, may be this.
But result will be in a separate cell, only way to result in original cell is with VBA or UDF as Rick shown.

Book3.xlsx
AB
1314714,cashboard,data1,"data2,mark,done"314714,cashboard,data1,"data2 mark done"
Sheet1013
Cell Formulas
RangeFormula
B1B1=LEFT(A1,FIND("""",A1)-1)&SUBSTITUTE(MID(A1,FIND("""",A1),99),","," ")
 
Upvote 0
With formula, may be this.
But result will be in a separate cell, only way to result in original cell is with VBA or UDF as Rick shown.

Oops, I meant, only way to result in original cell is with VBA only.
 
Upvote 0
All yours suggestions worked perfectly.

Thank you very much !!!?
 
Upvote 0

Forum statistics

Threads
1,214,908
Messages
6,122,187
Members
449,071
Latest member
cdnMech

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top