Private Sub CommandButton1_Click()
Dim i&, fin&
If modif Then
Application.EnableEvents = False
With Feuil5
For i = 11 To 22
.Range("B" & i - 9).Value = Me.Controls("TextBox" & i).Value
Next i
End With
Application.EnableEvents = True
With Feuil7
For i = 1 To 22
.Cells(lign, i) = Controls("Textbox" & i): Controls("Textbox" & i) = ""
Next i
End With
Unload Me: GoTo 1
End If
If TextBox1 <> "" And TextBox2 <> "" And TextBox3 <> "" Then
With Feuil5
For i = 11 To 22
.Range("B" & i - 9).Value = Me.Controls("TextBox" & i).Value
Next i
End With
Application.EnableEvents = True
With Feuil7
fin = .Range("A" & Rows.Count).End(xlUp).Row + 1
For i = 1 To 22
.Cells(fin, i) = Controls("Textbox" & i): Controls("Textbox" & i) = ""
Next i
End With
Else
MsgBox "Vous devez au minimum renseigner, Le fluide, Le site, N° de compteur", , "Manque de données": Exit Sub
1 End If
Call Classer: 'Classer est une procedure
Unload Me
If modif Then
rech = UserForm1.TextBox1: Unload UserForm1: UserForm1.TextBox1 = rech: UserForm1.Show:
End If
modif = 0
End Sub