[算表] VBA變數字元限制

看板Office作者 (Blue night)時間4年前 (2020/04/02 15:55), 編輯推噓0(002)
留言2則, 2人參與, 4年前最新討論串1/1
軟體: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://www.ptt.cc/bbs/Office/M.1585814139.A.9F9.html

04/02 16:03, 4年前 , 1F
aplication.substitute(..)改為replace(...)
04/02 16:03, 1F

04/02 16:39, 4年前 , 2F
驚 謝謝S大
04/02 16:39, 2F
文章代碼(AID): #1UXPfxdv (Office)