Hi vba gurus - I am hoping to get some help after trying many times without success.
I have a range of data ("A1:D11"), the first row is a header row
----A-------B-------C--------D-------
----ID---Amount----ID----Amount-----
---101-----$10-----113-----$2--------
---102-----$45-----110-----$5--------
---103-----$78-----122-----$8--------
---104-----$93-----100----$45--------
---105-----$56-----101----$63--------
---106-----$42-----102----$92--------
---107----$552-----106----$84--------
---108-----$11-----107----$72--------
---109----$214-----105----$15--------
---110-----$11-----108----$61--------
This is currently what I have in column F with blanks in between
--F--
101
102
105
106
107
108
110
This is what I want in column F (Without Blanks)
--F--
101
102
105
106
107
108
110
Sub ResizeDynArr()
Dim Arr As Variant
Dim nuArr As Variant
Arr = Range("A2:D11")
ReDim nuArr(1 To UBound(Arr), 1 To 1)
For i = 1 To UBound(Arr)
For j = 1 To UBound(Arr)
If Arr(i, 1) = Arr(j, 3) Then
nuArr(i, 1) = Arr(i, 1)
End If
Next
Next
Cells(2, "F").Resize(UBound(nuArr), 1) = nuArr
End Sub
Bookmarks