kann mir einr Helfen.
Ich habe ein Tabellenblatt vom 01.01.2020 bis 31.12.2020 und dieses soll mit in einer Listbox angezeigt werden. Die Anzeige läuft jedoch nur bis zum 18.12.2020.
Ich habe diesen Befehl eingetragen:
Private Sub CommandButton1_Click()
Sheets("Tabelle12").Select
Dim Ind%, n%
Ind = ListBox1.ListIndex
Arr(Ind + 1, 1) = TextBox1.Value
Arr(Ind + 1, 2) = TextBox2.Value
Arr(Ind + 1, 3) = TextBox3.Value
Arr(Ind + 1, 4) = TextBox4.Value
Arr(Ind + 1, 5) = TextBox5.Value
Arr(Ind + 1, 6) = TextBox6.Value
Arr(Ind + 1, 8) = TextBox7.Value
Arr(Ind + 1, 9) = TextBox8.Value
Arr(Ind + 1, 10) = TextBox9.Value
Arr(Ind + 1, 11) = TextBox10.Value
With ListBox1
.Clear
.List = Arr
For n = 2 To .ListCount - 1
.List(n, 1) = Format(.List(n, 1), "dd.MM.yyyy")
'.List(n, 2) = Format(.List(n, 2), "hh:mm")
'.List(n, 3) = Format(.List(n, 3), "hh:mm")
'.List(n, 4) = Format(.List(n, 4), "hh:mm")
Next n
.ListIndex = Ind
End With
'Dim n%
n = Application.WorksheetFunction.Count(Range(Cells(11, 1), Cells(369, 1)))
Range("a4:k" & n + 11) = Arr
Worksheets("Tabelle12").Calculate
End Sub
UNDPrivate Sub UserForm_Initialize()
Sheets("Tabelle12").Select
Dim i%, j%, n%
n = Application.WorksheetFunction.Count(Range(Cells(11, 1), Cells(369, 1)))
Arr = Range("a4:k" & n + 11)
With ListBox1
.ColumnCount = 11
.ColumnHeads = False
.List = Arr
For n = 2 To .ListCount - 1
.List(n, 1) = Format(.List(n, 1), "dd.MM.yyyy")
'.List(n, 2) = Format(.List(n, 2), "hh:mm")
'.List(n, 3) = Format(.List(n, 3), "hh:mm")
Next n
.ListIndex = 0
End With
TextBox1.Value = Arr(ListBox1.ListIndex + 1, 1)
TextBox2.Value = Arr(ListBox1.ListIndex + 1, 2)
TextBox3.Value = Arr(ListBox1.ListIndex + 1, 3)
TextBox4.Value = Arr(ListBox1.ListIndex + 1, 4)
TextBox5.Value = Arr(ListBox1.ListIndex + 1, 5)
TextBox6.Value = Arr(ListBox1.ListIndex + 1, 6)
TextBox7.Value = Arr(ListBox1.ListIndex + 1, 8)
TextBox8.Value = Arr(ListBox1.ListIndex + 1, 9)
TextBox9.Value = Arr(ListBox1.ListIndex + 1, 10)
TextBox10.Value = Arr(ListBox1.ListIndex + 1, 11)
Worksheets("Tabelle12").Calculate
End Sub
Alles geht nur bis zum 18.12.2020Liebe Grüße JoHa