作者StratApostle (acidjazz)
看板Visual_Basic
標題[VBA ] 使用者自訂型態尚未定義 excel 2021
時間Sat May 7 11:34:14 2022
全部程式如下,照著教材上面的輸入後
在儲存格KEY自己設計的function
但是跑出使用者自訂型態尚未定義訊息
https://imgur.com/YjOvnyG
Public Function asdf(a As interger, b As interger)
asdf = a + b
End Function
GOOGLE後 依照指示
工具->設定引用項目 把下面打勾
Microsoft Scripting Runtime
Microsoft VBScript Regular Expressions
後續還是一樣錯誤
如何實踐自定義function呢
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 1.169.192.77 (臺灣)
※ 文章網址: https://www.ptt.cc/bbs/Visual_Basic/M.1651894456.A.5B6.html
→ vanchy: 你少了as integer 05/07 13:08
→ StratApostle: 看是有 Public Function asdf(a As interger 05/07 15:10
推 LPH66: 不是參數, 是函數回傳值, 寫在 () 後面 05/07 22:34
推 kumasan123: a as integer, b as integer 您拼字多了 05/07 23:22
→ LPH66: 哦對耶, 錯誤是自訂型態尚未定義, 表示 VBA 看到了一個 05/11 18:52
→ LPH66: 認不得的型別就當它成自訂型態, 然後就說我找不到這玩意 05/11 18:53