I've tried by hours to cope with this error, search solutions, but nothing is clear for me.
- I've imported successfully items from Excel to combobox (>19 appearances)
- Now I have duplicates in combo. I wanna iterate by Excel sheet, compare with Combobox & remove unnecessary items (except single one)
- I have
error 381 - Could not get the Column property array index.
Dim N As Long, K As Long, counter As Long
With Sheets("Główne")
N = .Cells(Rows.Count, 12).End(xlUp).Row
End With
Dim ostatnia As Long
ostatnia = Cells(Rows.Count, 11).End(xlUp).Row
For i = 1 To ostatnia
Range("I" & i + 1).Formula = "=COUNTIFS(L:L,L" & i + 1 & ")"
Next
ComboBox1.Clear
For K = 1 To N
If Cells(K + 1, 9).Value > 19 Then
ComboBox1.AddItem Sheets("Główne").Cells(K + 1, 12).Value
End If
Next K
Range("I2:I" & ostatnia).Select
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
'############### problem is somewhere below ##############'
For S = 2 To N
counter = 1
For iteracjalista = 0 To ComboBox1.ListCount - 1
If ComboBox1.Column(0, iteracjalista) = Sheets("Główne").Cells(S + 1, 12).Value Then
If Sheets("Główne").Cells(S + 1, 9).Value > counter Then
ComboBox1.RemoveItem 1
counter = counter + 1
End If
End If
Next iteracjalista
Next S
Probably problem is in last part of code. But I have no idea how I should fix it. Could you help me?