首頁>Club>
9
回覆列表
  • 1 # 拓語教育

    Sub 提取漢字()

    Dim regx As New VBScript_RegExp_55.RegExp

    Dim arr1

    arr1 = Application.WorksheetFunction.Transpose(Range("A2:A15"))

    For k = 1 To UBound(arr1)

    With regx

    .Global = True

    .IgnoreCase = True

    .Pattern = "[^0-9a-z ]+"

    Cells(k + 1, 2) = .Execute(arr1(k))(0)

    End With

    Next

    End Sub

    Sub 提取英文()

    Dim rex As New VBScript_RegExp_55.RegExp

    Dim arr2

    arr2 = Application.WorksheetFunction.Transpose(Range("A2:A15"))

    For i = 1 To UBound(arr2)

    With rex

    .Global = True

    .IgnoreCase = True

    .Pattern = "[a-z ]+"

    Cells(i + 1, 3) = .Execute(arr2(i))(0)

    End With

    Next

    End Sub

  • 中秋節和大豐收的關聯?
  • 一個企業想採用軍事化管理前提是什麼?