作者home0303 (Blue night)
看板Office
标题[算表] VBA变数字元限制
时间Thu Apr 2 15:55:37 2020
软体:EXCEL
版本:2010
自订一个函数
Function CountStr(范围, 字串)
For Each cell In 范围
过渡 = (Len(cell) - Len(Application.Substitute(cell, 字串, ""))) / Len(字串)
CountStr = CountStr + 过渡
Next
End Function
这个函数目的是要回传储存格内有几个指定的字串
原本使用好好的 最近发现 当储存格的字元 >=256 时 函数会错误
请问我该在哪边做什麽宣告 来解决这个问题呢
谢谢
--
※ 发信站: 批踢踢实业坊(ptt.cc), 来自: 223.136.131.134 (台湾)
※ 文章网址: https://webptt.com/cn.aspx?n=bbs/Office/M.1585814139.A.9F9.html
1F:→ soyoso: aplication.substitute(..)改为replace(...) 04/02 16:03
2F:→ home0303: 惊 谢谢S大 04/02 16:39