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

What did Pito Salas invent?
Pito Salas, working for Lotus, popularized what would become to be pivot tables. It was released as Lotus Improv in 1989.
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,214,944
Messages
6,122,391
Members
449,080
Latest member
Armadillos

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