VBA構造函數就是這么簡單


Function test(a As Integer)'構造函數名字為test參數為a且為int型
  If a >= 90 Then
     Debug.Print "優秀"
     test = "優秀" '賦值到單元格,跨表依然適用
  ElseIf a >= 60 Then
     Debug.Print "及格"
     test = "及格"
  Else
     Debug.Print "不及格"
     test = "不及格"
  End If
 
End Function


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM