小编Pet*_*ter的帖子

在 Excel 脚本中用点替换逗号

我想用点替换逗号,反之亦然

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 …
Run Code Online (Sandbox Code Playgroud)

excel vba

6
推荐指数
2
解决办法
6万
查看次数

标签 统计

excel ×1

vba ×1