Hello guys,
i'm storing a range of variables into a 1d array and i want to remove the duplicate variables beforehand instead of clearing the array after.
My function is:
Currently it doesn't run because arTmp is empty.
My idea was to make:
but that doesn't work. And i don't really want to remeasure my range selection after duplicates have been removed, nor do i want to add empty cells into array, what would be the best way to proceed?
I can of course make my own remove duplicates function, but i can just run that on the array later
i'm storing a range of variables into a 1d array and i want to remove the duplicate variables beforehand instead of clearing the array after.
My function is:
Code:
Function StoringIntoArray(startSKU As Long, endSKU As Long, columnSKU As Long)
Dim arTmp
Dim skuArray()
Dim counter As Long, i As Long
Range(Cells(startSKU, columnSKU), Cells(endSKU, columnSKU)).RemoveDuplicates Columns:=Array(1), Header:=xlNo
counter = UBound(arTmp, 1)
ReDim skuArray(1 To counter)
For i = 1 To counter
skuArray(i) = arTmp(i, 1)
Next i
Erase arTmp
StoringIntoArray = skuArray()
End Function
Currently it doesn't run because arTmp is empty.
My idea was to make:
Code:
arTmp = Range(Cells(startSKU, columnSKU), Cells(endSKU, columnSKU)).RemoveDuplicates Columns:=Array(1), Header:=xlNo
I can of course make my own remove duplicates function, but i can just run that on the array later
Last edited: