Private Sub CommandButton1_Click()
Unload UserForm1
End Sub
Private Sub TextBox1_Change()
Application.EnableEvents = False
[AM1] = UserForm1.TextBox1
[AJ1].Select
Calculate
Application.EnableEvents = True
End Sub
et comme événementielle :
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
On Error GoTo Fin
If Target.Count > 1 Then Exit Sub
If Not Intersect(Target, [AM1]) Is Nothing Then
UserForm1.Show 0
End If
Fin:
End Sub