【发布时间】:2021-03-02 19:06:58
【问题描述】:
如何替换工作表中的多个单词?
类似的词:Da...da、Do...do、Dos、De...de.. 等
如何在名为“Customers3”的电子表格中调整它?
Public Function MyProper(MyString As String, Optional exceptions As Variant)
Dim c As Variant
If IsMissing(exceptions) Then
exceptions = Array("a", "as", "e", "o", "os", "da", "das", "de", "di", "do", "dos", _
"CPF", "RG", "E-Mail")
End If
MyString = Application.Proper(MyString)
For Each c In exceptions
MyString = Replace(" " & MyString & " ", " " & c & " ", " " & LCase(c) & " ", , , vbTextCompare)
Next c
MyProper = MyString
End Sub
【问题讨论】:
-
你是如何尝试使用这个功能的?
-
我有几个包含客户数据、姓名、地址的电子表格,我使用了“ProperFunction”来正确处理,但粒子的第一个字母也是大写的,不应该是这样。 -对不起,我不太懂英语
-
在 Excel 中使用它会发生什么?例如,
=MyProper(A1)? -
我需要在每个电子表格中更改它,并且由于我仍在学习,我不知道如何将它插入代码中。你能告诉我怎么做吗?
标签: excel vba replaceall