Quantcast
Channel: Active questions tagged excel - Stack Overflow
Viewing all articles
Browse latest Browse all 88087

Replace dot with comma, and comma with dot

$
0
0

I am trying to replace dots with commas and commas with dots. The data is not always the same length. I created a button (Form controls) for the code.

I tried writing the code for replacing dots with commas. The code works for replacing dots with commas. However Excel gets stuck. How do I add the part to replace commas with dots?

Sub ReplacePointWithComma()

Dim Cell As Range

ActiveSheet.Range("D:I").Select

For Each Cell In Selection
    Cell.Value = Replace(Cell.Value, ",", ".")
Next

End Sub

Viewing all articles
Browse latest Browse all 88087

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>