Change Dot to Comma

MrThor

New Member
Joined
Aug 13, 2018
Messages
36
Hi

I want to find all my dots in my excel sheet and replace them with Comma. I used the macro recorder to try to find a way and got the code below. However it doesnt work, if I have a number like 12345.6789 it will turn to 123456789 after the macro. Anyone knows how to fix it?

Code:
    Cells.Replace What:=".", Replacement:=",", LookAt:=xlPart, SearchOrder _
        :=xlByRows, MatchCase:=False, SearchFormat:=False, ReplaceFormat:=False
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).
Hi,

You can test Chr(46) and Chr(44) to replace "." and ","

Hope this will help
 
Upvote 0
replace is a string operator . .
tested with '12345.6789 your code works: result '12345,6789
what is the source? manual typed numbers or imported?
 
Upvote 0
[B3].Value = Replace([B3], ".", ",")
strange things happen here . . . cell formatting has influence
 
Last edited:
Upvote 0

Forum statistics

Threads
1,223,893
Messages
6,175,241
Members
452,622
Latest member
Laura_PinksBTHFT

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