Private Sub Label1_Click()
TextBox1.Text = Label1.Name
End Sub
Private Sub Label1_Click()
TextBox1 = Label1.Name
End Sub
Public WithEvents LabelGroup As MSForms.Label
Private Sub LabelGroup_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
Dim i As Integer
i = Right(LabelGroup.Name, 1)
UserForm1.Controls("TextBox1").Text = LabelGroup.Name
End Sub
i = CDbl(Replace(LabelGroup.Name, "TextBox", "", 1))
i = Right(LabelGroup.Name, 1)
Mais pour ne pas bugger dans ton appli, je te recommande cette petite modif :
au lieu du code trop rapidement fait ...Code:i = CDbl(Replace(LabelGroup.Name, "TextBox", "", 1))
Code:i = Right(LabelGroup.Name, 1)
i = CDbl(Replace(LabelGroup.Name, "Label", ""))