This seems to be a continuation of my answer to your previous question, but if so, I think you misunderstood what I had in mind. I accepted your code and amended my suggestion, but I have not tested it:
Public Sub VirgulaPunct() Dim oRow As Range Dim cell As Range Dim i As Long, j As Long Dim MyString As String Dim aux As String Application.ScreenUpdating = False For i = Selection(Selection.Count).Row To Selection.Cells(1, 1).Row Step -1 For j = Selection(Selection.Count).Column To Selection.Cells(1, 1).Column Step -1 MyString = Cells(i, j).Value MyString = Replace(MyString, ",", ";+;", 1) MyString = Replace(MyString, ".", ",", 1) MyString = Replace(MyString, ";+;", ".", 1) Cells(i, j).Value = MyString Next j Next i Application.ScreenUpdating = True End Sub
So, as I said in my previous answer, I make 3 calls to Replace , but I make them for the whole line, not for the character in the line.
In the future, it would probably be better if you updated the original question rather than created a new one, and then you could leave a comment for me under my answer, and I saw that you did.
source share