Option Explicit 'Startseite neu
Dim i As Integer
Private Sub ComboBox1_Change()
Call Speichern_aktivieren 'Button aktivieren!!
With Tabelle4.ListObjects("Tabelle2").DataBodyRange
For i = 1 To .Rows.Count
If .Cells(i, 1) = ComboBox1 Then
CommandButton1.Visible = False
Exit Sub
Else
CommandButton1.Visible = True
End If
Next i
End With
End Sub
Private Sub ComboBox2_Change()
Call Speichern_aktivieren 'Button aktivieren!!
With Tabelle4.ListObjects("Tabelle3").DataBodyRange
For i = 1 To .Rows.Count
If .Cells(i, 1) = ComboBox2 Then
CommandButton2.Visible = False
Exit Sub
Else
CommandButton2.Visible = True
End If
Next i
End With
End Sub
Private Sub ComboBox3_Change()
Call Speichern_aktivieren 'Button aktivieren!!
With Tabelle4.ListObjects("Tabelle4").DataBodyRange
For i = 1 To .Rows.Count
If .Cells(i, 1) = ComboBox3 Then
CommandButton3.Visible = False
Exit Sub
Else
CommandButton3.Visible = True
End If
Next i
End With
End Sub
Private Sub ComboBox4_Change()
Call Speichern_aktivieren 'Button aktivieren!!
With Tabelle4.ListObjects("Tabelle5").DataBodyRange
For i = 1 To .Rows.Count
If .Cells(i, 1) = ComboBox4 Then
CommandButton4.Visible = False
Exit Sub
Else
CommandButton4.Visible = True
End If
Next i
End With
End Sub
Private Sub ComboBox5_Change()
Call Speichern_aktivieren 'Button aktivieren!!
With Tabelle4.ListObjects("Tabelle6").DataBodyRange
For i = 1 To .Rows.Count
If .Cells(i, 1) = ComboBox5 Then
CommandButton5.Visible = False
Exit Sub
Else
CommandButton5.Visible = True
End If
Next i
End With
End Sub
Private Sub ComboBox6_Change()
Call Speichern_aktivieren 'Button aktivieren!!
With Tabelle4.ListObjects("Tabelle7").DataBodyRange
For i = 1 To .Rows.Count
If .Cells(i, 1) = ComboBox6 Then
CommandButton6.Visible = False
Exit Sub
Else
CommandButton6.Visible = True
End If
Next i
End With
End Sub
Private Sub CommandButton1_Click()
Dim i&, j&, iZeile&, arrList, arrTemp
With Tabelle4.ListObjects("Tabelle2").DataBodyRange
iZeile = .Rows.Count + 1
.Cells(iZeile, 1) = ComboBox1
End With
With Tabelle4.ListObjects("Tabelle2").DataBodyRange
arrList = .Value
For i = 1 To iZeile - 1
For j = i + 1 To iZeile
If arrList(i, 1) > arrList(j, 1) Then
arrTemp = arrList(j, 1)
arrList(j, 1) = arrList(i, 1)
arrList(i, 1) = arrTemp
End If
Next j
Next i
.Value = arrList
End With
Call Alle_Comboboxen_löschen
End Sub
Private Sub CommandButton2_Click()
Dim i&, j&, iZeile&, arrList, arrTemp
With Tabelle4.ListObjects("Tabelle3").DataBodyRange
iZeile = .Rows.Count + 1
.Cells(iZeile, 1) = ComboBox2
End With
With Tabelle4.ListObjects("Tabelle3").DataBodyRange
arrList = .Value
For i = 1 To iZeile - 1
For j = i + 1 To iZeile
If arrList(i, 1) > arrList(j, 1) Then
arrTemp = arrList(j, 1)
arrList(j, 1) = arrList(i, 1)
arrList(i, 1) = arrTemp
End If
Next j
Next i
.Value = arrList
End With
Call Alle_Comboboxen_löschen
End Sub
Private Sub CommandButton3_Click()
Dim i&, j&, iZeile&, arrList, arrTemp
With Tabelle4.ListObjects("Tabelle4").DataBodyRange
iZeile = .Rows.Count + 1
.Cells(iZeile, 1) = ComboBox3
End With
With Tabelle4.ListObjects("Tabelle4").DataBodyRange
arrList = .Value
For i = 1 To iZeile - 1
For j = i + 1 To iZeile
If arrList(i, 1) > arrList(j, 1) Then
arrTemp = arrList(j, 1)
arrList(j, 1) = arrList(i, 1)
arrList(i, 1) = arrTemp
End If
Next j
Next i
.Value = arrList
End With
Call Alle_Comboboxen_löschen
End Sub
Private Sub CommandButton4_Click()
Dim i&, j&, iZeile&, arrList, arrTemp
With Tabelle4.ListObjects("Tabelle5").DataBodyRange
iZeile = .Rows.Count + 1
.Cells(iZeile, 1) = ComboBox4
End With
With Tabelle4.ListObjects("Tabelle5").DataBodyRange
arrList = .Value
For i = 1 To iZeile - 1
For j = i + 1 To iZeile
If arrList(i, 1) > arrList(j, 1) Then
arrTemp = arrList(j, 1)
arrList(j, 1) = arrList(i, 1)
arrList(i, 1) = arrTemp
End If
Next j
Next i
.Value = arrList
End With
Call Alle_Comboboxen_löschen
End Sub
Private Sub CommandButton5_Click()
Dim i&, j&, iZeile&, arrList, arrTemp
With Tabelle4.ListObjects("Tabelle6").DataBodyRange
iZeile = .Rows.Count + 1
.Cells(iZeile, 1) = ComboBox5
End With
With Tabelle4.ListObjects("Tabelle6").DataBodyRange
arrList = .Value
For i = 1 To iZeile - 1
For j = i + 1 To iZeile
If arrList(i, 1) > arrList(j, 1) Then
arrTemp = arrList(j, 1)
arrList(j, 1) = arrList(i, 1)
arrList(i, 1) = arrTemp
End If
Next j
Next i
.Value = arrList
End With
Call Alle_Comboboxen_löschen
End Sub
Private Sub CommandButton6_Click()
Dim i&, j&, iZeile&, arrList, arrTemp
With Tabelle4.ListObjects("Tabelle7").DataBodyRange
iZeile = .Rows.Count + 1
.Cells(iZeile, 1) = ComboBox6
End With
With Tabelle4.ListObjects("Tabelle7").DataBodyRange
arrList = .Value
For i = 1 To iZeile - 1
For j = i + 1 To iZeile
If arrList(i, 1) > arrList(j, 1) Then
arrTemp = arrList(j, 1)
arrList(j, 1) = arrList(i, 1)
arrList(i, 1) = arrTemp
End If
Next j
Next i
.Value = arrList
End With
Call Alle_Comboboxen_löschen
End Sub