Is there a way to declare a public variable and also assign value?
This is the code in a sub which works perfectly:
Option Explicit
Sub test()
Dim arrStatistics As Variant
'Set arrStatistics
arrStatistics = Array("H/T - Goal Scored", "H/T - Goal Conceded", "H/T - Both teams Scored", "H/T - Over 0.5", "H/T - Over 1.5", "H/T - Over 2.5", "H/T - Result" _
, "F/T - Goal Scored", "F/T - Goal Conceded", "F/T - Both teams Scored", "F/T - Over 0.5", "F/T - Over 1.5", "F/T - Over 2.5", "F/T - Result")
End Sub
This is how a declare the variable to act as Public:
Public arrStatistics As Variant
BUT when i use this i receive an error:
Public arrStatistics As Variant
'Set arrStatistics
arrStatistics = Array("H/T - Goal Scored", "H/T - Goal Conceded", "H/T - Both teams Scored", "H/T - Over 0.5", "H/T - Over 1.5", "H/T - Over 2.5", "H/T - Result" _
, "F/T - Goal Scored", "F/T - Goal Conceded", "F/T - Both teams Scored", "F/T - Over 0.5", "F/T - Over 1.5", "F/T - Over 2.5", "F/T - Result")
Const, like so:Public Const SomeText As String = "This is a Constant!". But, to reiterate, this won't work with an Array.