我是靠谱客的博主 爱笑画板,这篇文章主要介绍Excel 将单个单元格数字求和,现在分享给大家,希望可以做个参考。

首先自定义正则表达式函数

Function ExStr(Str As String, Parttern As String, ActionID As Integer, Optional RepStr As String = "")
Dim regex As Object
Set regex = CreateObject("vbscript.regexp")
With regex
.Global = True
.IgnoreCase = True
.MultiLine = True
.Pattern = Parttern
End With
Select Case ActionID
Case 1:
ExStr = regex.Replace(Str, RepStr)
Case 2:
ExStr = regex.test(Str)
Case 3:
Dim matches As Object
Set matches = regex.Execute(Str)
For Each Match In matches
ExStr = ExStr + CInt(Match.Value)
Next
End Select
End Function

加入宏 mudule中

ex:DALIAN CHINA: 12#LOS ANGELES CA: 1#DALIAN CHINA: 2#SAN DIEGO: 1#JINHE: 1#LOS ANGELES CA: 1#

formula: =ExStr($D3,"d+",3)

最后

以上就是爱笑画板最近收集整理的关于Excel 将单个单元格数字求和的全部内容,更多相关Excel内容请搜索靠谱客的其他文章。

本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
点赞(115)

评论列表共有 0 条评论

立即
投稿
返回
顶部