I have the following code:
Private Enum dbi
m = 0
d = 1
y = 2
hh = 3
mm = 4
ss = 5
ap = 6
size = 7
End Enum
...
Sub CompileData()
...
ReDim startEnd(deplCount * 2) As Date
ReDim excludes(deplCount * 2) As Date
ReDim hasExcls(deplCount) As Boolean
ReDim deplLabels(deplCount) As MSForms.Label
ReDim startLabels(deplCount) As MSForms.Label
ReDim endLabels(deplCount) As MSForms.Label
ReDim exclLabels(deplCount) As MSForms.Label
ReDim exclChecks(deplCount) As MSForms.CheckBox
ReDim mdyLabels(dbi.size * 2 * deplCount) As MSForms.Label
ReDim dateGroup(dbi.size * 4 * deplCount) As MSForms.TextBox
ReDim pctLabels(dbi.size * 4 * deplCount) As MSForms.Label
Dim okButton As MSForms.CommandButton
...
End Sub
Note these two chunks lie in the same module, so even though the Enum is private, CompileData should still be able to access it.
I am ReDimming some arrays because I am not sure before the program launches how much data I am going to need to collect from this userform. This code has worked for a month, but now for some reason I am getting a constant expression compile error in the CompileData sub that specifically highlights "dbi.size." Are Enums suddenly not considered constant definitions? If I'm ReDimming, should it even matter?