Private Sub CommandButton2_Click() 'Valider
Dim sel As Range, w As Worksheet
ActiveCell.Activate 'si un objet est sélectionné
Set sel = Selection
TextBox1 = Abs(Int(Val(TextBox1)))
TextBox2 = Abs(Int(Val(TextBox2)))
Application.ScreenUpdating = False
For Each w In Sheets(Array("Feuil1", "Feuil2")) 'noms à adapter
If TextBox1 Then
w.Rows(27).Resize(TextBox1).Insert
w.Rows(26).Copy
w.Rows(27).Resize(TextBox1).PasteSpecial xlPasteFormulas
End If
If TextBox2 Then
w.Columns("G").Resize(, TextBox2).Insert
w.Columns("F").Copy
w.Columns("G").Resize(, TextBox2).PasteSpecial xlPasteFormulas
End If
Next
Application.CutCopyMode = 0
sel.Select
End Sub