title: Replacing commas with dots in Excel script
body: <p>I want to replace a comma with dot and vice-versa</p>
  
  <pre><code>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
              For Counter = 1 To Len(MyString)
                  aux = Mid(MyString, Counter, 1)
                  If aux = "." Then
  
                    MyString = Replace(MyString, ".", ",", 1)
  
                  ElseIf aux = "," Then
  
                    MyString = Replace(MyString, ",", ".", 1)
  
                  End If
              Next
              Cells(i, j).Value = MyString
          Next j
      Next i
      Application.ScreenUpdating = True
  End Sub
  </code></pre>