Ich habe kl. Problem :
Folgender Code funzt aber nur solange ich bei einer Combobox bleibe :
Private Sub UserForm_Initialize()
Dim oListe3, oListe1, oListe2
Dim LoI, LoI1, LoI2 As Long
Dim arrListe3, arrListe1, arrListe2 As Long
Set oListe1 = CreateObject("Scripting.dictionary")
Workbooks.Open ("XXX")
With Worksheets("Tabelle1")
For LoI = 5 To Worksheets("Tabelle1").UsedRange.Rows.Count 'To 5600
If Cells(LoI, 2) "" & Rows(LoI).Hidden = False Then ComboBox1.AddItem Cells(LoI, 2)
oListe1(Cells(LoI, 2).Value) = 0
Next LoI
arrListe1 = oListe1.keys
UserForm4.ComboBox1.List = arrListe1
end with
ChDir ("XXX")
Workbooks("XXX").Close (False)
End Sub
Will ich mehrere (3) like so :
Private Sub UserForm_Initialize()
Dim oListe3, oListe1, oListe2
Dim LoI, LoI1, LoI2 As Long
Dim arrListe3, arrListe1, arrListe2 As Long
Set oListe1 = CreateObject("Scripting.dictionary")
Set oListe2 = CreateObject("Scripting.dictionary")
Set oListe3 = CreateObject("Scripting.dictionary")
Workbooks.Open ("XXX")
With Worksheets("Tabelle1")
For LoI = 5 To Worksheets("Tabelle1").UsedRange.Rows.Count 'To 5600
If Cells(LoI, 2) "" & Rows(LoI).Hidden = False Then ComboBox1.AddItem Cells(LoI, 2)
oListe1(Cells(LoI, 2).Value) = 0
'If Cells(LoI, 3) "" & Rows(LoI).Hidden = False Then ComboBox2.AddItem Cells(LoI, 3)
oListe2(Cells(LoI, 3).Value) = 0
'If Cells(LoI, 4) "" & Rows(LoI).Hidden = False Then ComboBox3.AddItem Cells(LoI, 4)
oListe3(Cells(LoI, 4).Value) = 0
' End If
Next LoI
arrListe1 = oListe1.keys '& oListe2.keys & oListe3.keys
UserForm4.ComboBox1.List = arrListe1
arrListe2 = oListe2.keys
UserForm4.ComboBox2.List = arrListe2
arrListe3 = oListe3.keys
UserForm4.ComboBox3.List = arrListe3
End With
ChDir ("XXX")
Workbooks("XXX").Close (False)
End Sub
bekomme ich nur Fehlermeldungen.
Wer hat `ne Idee bzw kann mir helfen.
Danke im voraus ...