Private Sub UserForm_Initialize()
Dim bouton As Control
Dim i As Integer, k As Integer, H As Integer, G As Integer
Sheets("Produitnouvelleliste").Select
'creation des boutons
For k = 0 To MultiPage1.Pages.Count - 1 'pour chaque page du multipage
H = 4: G = -140 ' Positions Haut et Gauche
For i = 2 To 476 ' lignes de la feuille Produitnouvelleliste
If Cells(i, 1) = MultiPage1.Pages(k).Caption Then
G = G + 145
If G > 730 Then
H = H + 75
G = 5
End If
Set bouton = Me.MultiPage1.Pages(k).Controls("Frame" & k + 2).Controls.Add("Forms.CommandButton.1", , True)
With bouton
.Caption = Cells(i, 2)
.Top = H
.Left = G
.Tag = i
.Width = 140
.Height = 70
End With
End If
Next
Next
End Sub