Duplicate Certain Character In Cell

henz999

New Member
Joined
Jul 11, 2022
Messages
1
Office Version
  1. 365
Platform
  1. Windows
Hello everyone,

I need help on how to duplicate certain character in a cell if it is found. For instance, I would like to duplicate character ' for every this single character that is found.
Sample Data:
Rich'ard
An'dre'as
Anthon'y

Expected Result
Rich''ard
An''dre''as
Anthon''y

The reason why I want to duplicate character ' is because I will be passing these characters to database function. As you probably know, if we don't duplicate the character, it would be treated as enclosing text argument thus result in error. If it is duplicated, it would be skipped and passed as actual ' character.

Warm Regards
 

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off
Hi & welcome to MrExcel.
How about
Fluff.xlsm
AB
1
2Rich'ardRich''ard
3An'dre'asAn''dre''as
4Anthon'yAnthon''y
Data
Cell Formulas
RangeFormula
B2:B4B2=SUBSTITUTE(A2,"'","''")
 
Upvote 0
Solution

Forum statistics

Threads
1,214,639
Messages
6,120,679
Members
448,977
Latest member
dbonilla0331

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