Hello all,
I am having trouble with adding elements to my multi dimensional array.
everytime i try to re-dimension it, increasing its number of elements by 1 i receive an error.
here is the code i am using
'Resource Name, top_row,bottom_row
Dim Resources() As Variant
ReDim Resources(0, 0 To 2) As Variant
Dim array_element_counter As Integer
For int_counter = 3 to last_row
Resources(array_element_counter, 0) = Workbooks(current_workbook).Worksheets(current_worksheet).Cells(top_row, new_relocation_column).value
Resources(array_element_counter, 1) = top_row
Resources(array_element_counter, 2) = bottom_row
array_element_counter = array_element_counter + 1
ReDim Preserve Resources(0 To UBound(Resources) + 1, 0 To 2) As Variant
next int_counter
i wish for my array to be redimensioned every time the for loop repeats, so that the new values of
.Cells(top_row, new_relocation_column).value , top_row, bottom_row all get added to the newly created element positions in the array
could somebody please let me know what im doing wrong.
Many thanks!!
Jordan
Bookmarks