VBA
15.01.2014 14:48:27
Markus
Ich hoffe ihr versteht das ich mein:). Helft mir!!
Mein code:
Private Sub ComboBox1_Change()
Dim spalte As Integer, zeile As Integer
ComboBox2.Clear
spalte = ComboBox1.ListIndex + 1
zeile = 2
While Sheets("Schaltung").Cells(zeile, spalte) ""
ComboBox2.AddItem Sheets("Schaltung").Cells(zeile, spalte)
zeile = zeile + 1
Wend
ComboBox2.ListIndex = 0
End Sub
Private Sub CommandButton1_Click()
Unload Me
End Sub
Private Sub CommandButton2_Click()
Sheets("Kaufliste").Range("b2") = ComboBox1
Sheets("Kaufliste").Range("c2") = ComboBox2
End Sub
Private Sub Label1_Click()
End Sub
Private Sub UserForm_Initialize()
Dim spalte As Integer
spalte = 1
While Sheets("Schaltung").Cells(1, spalte) ""
ComboBox1.AddItem Sheets("Schaltung").Cells(1, spalte)
spalte = spalte + 1
Wend
ComboBox1.ListIndex = 0
End Sub
Private Sub UserForm_QueryClose(Cancel As Integer, CloseMode As Integer)
Unload Me
End Sub
Meine exeltabelle:
A-----------------------------B
1Shimano-------------------SRAM
2XT M780 Gruppe 3x1-----X01 Gruppe 11s Gripshift
3180 ---------------------120