Just to repeat,
You can't declare a public variable in any procedure, and you can't declare a public variable in a class module (sheet module, ThisWorkbook, form, user-defined class).
Public variables must be declared at the top of a standard module, above any procedures, right below Option Explicit.
![]()
Option Explicit Public iJob As Integer Const iMax As Long = 15 Public asJob(1 To iMax) As String Sub x() asJob(1) = "Bob" MsgBox asJob(1) End Sub
Bookmarks