Collabora Office 21.06 Help
在模組級上 (而不是在子常式或函式中) 定義變數或陣列,從而使變數和陣列在所有的程式庫和模組中都有效。
Public VarName[(start To end)] [As VarType][, VarName2[(start To end)] [As VarType][,...]]
Public iPublicVar As Integer
Sub ExamplePublic
iPublicVar = iPublicVar + 1
MsgBox iPublicVar
End Sub