Public Function getComment(rng As Range) '自定義函數,帶一個參數,參數指向批注所在的單元格 On Error GoTo Line getComment = rng.Comment.Text '如果單元格中有插入批注,則函數返回批注的內容 Exit Function Line: getComment = "" '如果單元格中沒有插入批注,前面語句會報錯,然后指向此行代碼執行,函數返回空值 End Function
Public Function getComment(rng As Range) '自定義函數,帶一個參數,參數指向批注所在的單元格 On Error GoTo Line getComment = rng.Comment.Text '如果單元格中有插入批注,則函數返回批注的內容 Exit Function Line: getComment = "" '如果單元格中沒有插入批注,前面語句會報錯,然后指向此行代碼執行,函數返回空值 End Function
本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。