Thanks georgev.
Huh, i found the error, but now i need help to fix it.
This code fills certain important array:
Code:
Private Sub ArrayFill()
Dim r As Range
Set DataXCollection = New Collection
Set r = Worksheets("SheetX").Range("A1")
Do Until r = ""
'make sure we create a new instance of your custom type on every iteration
Set dx = New DataX
dx.CodeX = r.Text
dx.PriceX = r.Offset(, 1).Value
dx.ColorX = Application.Transpose(Range(r.Offset(1),
r.Offset(1).End(xlDown)))
dx.SizeX = Application.Transpose(Range(r.Offset(1, 1), r.Offset(1,
1).End(xlDown)))
Product.AddItem dx.CodeX
'add this reference of an instance of your custom type to
'to the DataXCollection collection for future use
'use the product code as the key
DataXCollection.Add dx, dx.CodeX ' dx.CodeX -key)
Set r = r.Offset(, 2)
Loop
Product.Text = "Input product"
End Sub
I didn't expect so many order items, so i made a Sheet for data storage (that feeds my combo), with data blocks ordered horizontally ('StateA' Sheet in attached file).
So that, when i arrive to the end of possible number of columns, and therefore try to add an extra data manually in my combo, "
ArrayFill() " procedure cannot fill DataXcollection collection (with dx objects), thus manually added data cannot be recognized.
Well, i need a twofold help here.
1) A code which will transpose my horizontaly oriented data blocks into verticaly oriented ones ('Needed' Sheet), because it takes an unacceptable amount of time to do it manually.
2) A redefined code for the (above-mentioned) "ArrayFill()" procedure to deal with verticaly ordered data blocks.
This help would save my life.