ich hab ein Problem mit dem automatischen Füllen von mehreren Multipage-Pages. Ich beabsichtige die einzelnen Registerkarten mit einer Schleife identisch zu füllen.
Eine einzelne Page zu füllen ist dabei kein Problem. Doch wie kann ich (Page1) durch (Page2) usw ersetzen? Mit Replace o.ä hat das bei mir nicht wirklich funktioniert. Könnte mir hier bitte jemand helfen?
Sub Test
Dim cntButx As MSForms.ToggleButton
Dim intAnzahl As Integer
Dim intAbstand As Integer
Dim intAbstand0 As Integer
Dim k As Integer
Dim i As Integer
intAnzahl = 34
intAbstand = 23
intAbstand0 = intAbstand
For i = 1 To 5
For k = 1 To 11
If ThisWorkbook.Sheets("Absenten").Range("B" & (7 + k)) "" Then
Set cntButx = Stundenplan.MP1.Page1.Controls.Add("Forms.ToggleButton.1", "cntBut" & _
k, True)
With cntButx
.Left = 65 * i
.Top = intAbstand + 33
.Width = 54
.Height = 22
.Caption = "Klicken"
.Tag = k
.FontSize = 9
.Font.Bold = True
End With
intAbstand = intAbstand + intAbstand0
End If
Stundenplan.MP1.Value = k - 1
Next k
Next i
End Sub
Vielen Dank bereits im Voraus!Viele Grüße
Peter