i found error.......when calculating ubound.......i used "Ubound(unique_file_array)" but it should have been "Ubound(unique_file_array,2)" to account for 2nd dimension.
see code below
ReDim unique_file_array(3, UBound(stdy_file_array1))
unique_file_array = stdy_file_array1
'For x = 1 To UBound(unique_file_array, 2)
'MsgBox (unique_file_array(1, x))
'MsgBox (unique_file_array(2, x))
'MsgBox (unique_file_array(3, x))
'Next x
MsgBox ("ubound unique is " & UBound(unique_file_array, 2))
For x = 1 To UBound(stdy_file_array2, 2)
match_found = False
For y = 1 To UBound(unique_file_array, 2)
If stdy_file_array2(1, x) = unique_file_array(1, y) Then
match_found = True
Exit For
End If
Next y
If Not match_found Then
MsgBox ("in not match found")
'ReDim Preserve unique_file_array(3, UBound(unique_file_array, 2))
ReDim Preserve unique_file_array(3, (UBound(unique_file_array, 2) + 1))
MsgBox ("ubound unique is " & UBound(unique_file_array, 2))
unique_file_array(1, UBound(unique_file_array, 2)) = stdy_file_array2(1, x)
unique_file_array(2, UBound(unique_file_array, 2)) = stdy_file_array2(2, x)
unique_file_array(3, UBound(unique_file_array, 2)) = stdy_file_array2(3, x)
End If
Next x
Bookmarks