Hi,

It was a very long time since I was here and now I'm totally lost!

I have never really learned the "Array"-thing, I have often used others macros - great, but not if you need to write one yourself and don't get it. This one should be really easy but I do not get the principal.

I have a range ("Skus") with approx. 2000 rows (1 column) with sku numbers (can vary). I only want to copy those sku numbers, which are 4 digits long, to another range. I Think this should be done with an array since it's fast - how do I do it, can someone explain this really easy ;-).


This is what I tried but it doesn't work and I do not know where to put "if len(...) = 4 then" and how to publish it etc etc...

Sub GetSkus()

Dim wsSheet As Worksheet
Dim rnRange As Range
Dim vaData As Variant
Dim i As Integer

Set wsBlad = Worksheets("Product")
Set rnRange = wsSheet.Range("Skus")

vaData = rnRange.Value

For i = 1 To UBound(vaData)
vaData(i, 1) = vaData(i + 1, 1)
Next i

Range("Active_Skus").Value = vaData

End Sub

Thanks // PiJay