Dieses VBA-Beispiel ist in einer UserForm eingebettet, welches
zur Dateneingabe verwendet wird. Es sind auch Dropdown Menüs
(ComboBox 1, 2,...) enthalten, die auf Tabellenblätter zugreifen und
die Auswahl ermöglichen. Da in einer Tabelle gewisse Angaben des
öfteren in den entsprechenden Zeilen vorkommen, möchte ich folgende Frage stellen:
Wie kann man bei einer ComboBox, welche alle vordefinierten Zeilen als
Auswahlliste anzeigt, so modifizieren, dass wenn zB. der Name Siemens
in mehr als 10 Zeilen steht, nur einmal dieser Name in der Auswahlliste
angezeigt wird?
Für Hinweise und Tipps wäre ich sehr dankbar.
Dim leRei As Long, dAt As Worksheet
Private Sub Calendar1_Click()
End Sub
Private Sub CommandButton2_Click()
Set dAt = ActiveWorkbook.Worksheets("Projekte")
leRei = dAt.Cells(Rows.Count, 2).End(xlUp).Row + 1
dAt.Cells(leRei, 2).Value = UserForm1.Calendar1.Day & "." & UserForm1.Calendar1.Month _
& "." & UserForm1.Calendar1.Year
dAt.Cells(leRei, 3).Value = UserForm1.TextBox1.Text
dAt.Cells(leRei, 4).Value = ComboBox1.Value
dAt.Cells(leRei, 5).Value = UserForm1.TextBox3.Text
dAt.Cells(leRei, 6).Value = ComboBox4.Value
dAt.Cells(leRei, 7).Value = UserForm1.TextBox5.Text
dAt.Cells(leRei, 8).Value = ComboBox8.Value
dAt.Cells(leRei, 10).Value = ComboBox6.Value
dAt.Cells(leRei, 11).Value = UserForm1.TextBox4.Text
dAt.Cells(leRei, 12).Value = ComboBox7.Value
dAt.Cells(leRei, 13).Value = ComboBox2.Value
dAt.Cells(leRei, 15).Value = ComboBox5.Value
dAt.Cells(leRei, 16).Value = ComboBox3.Value
End Sub
Private Sub CommandButton3_Click()
Unload UserForm1
End Sub
Private Sub UserForm_Initialize()
Me.ComboBox1.RowSource = "Auftraggeber!A2:A200"
Me.ComboBox7.RowSource = "Bearbeiter!A2:A200"
Me.ComboBox2.RowSource = "Auftraggeber!B2:B200"
Me.ComboBox3.RowSource = "Installationsfirma!A2:A200"
Me.ComboBox4.RowSource = "Bestellung!A2:A100"
Me.ComboBox6.RowSource = "Farbe!A2:A50"
Me.ComboBox8.RowSource = "Status!A2:A10"
Me.ComboBox5.RowSource = "Zustellung!A2:A100"
End Sub
Gruß Martin