i am trying to create a temp array with the first dimension being set to the ubound of another array, as my temp array will need to have the same number of rows. so here is a sample of my code
Dim AbsenceArray As Variant 'declare my asbence array, this populated by absences for all staff
AbsenceArray = Range("a1").CurrentRegion 'populate my array
ReDim Preserve AbsenceArray(1 To UBound(AbsenceArray, 1), 1 To UBound(AbsenceArray, 2)) 'resize my array and drop header
GetUbound = UBound(AbsenceArray, 1) 'using this to get ubound of absence array and will later use to set unbound of temp array
Dim TempArray(1 To GetUbound, 1 To 2) As Integer 'create my temp array
My code errors on the GetUbound variable, if I put in a static number of course it works with no error. Can someone please advise correct syntax. Thanks
Our community of experts have been thoroughly vetted for their expertise and industry experience.
The Distinguished Expert awards are presented to the top veteran and rookie experts to earn the most points in the top 50 topics.