Sub test1()
'
Dim xCount&, X1&, X2&, X3&
Dim HauteurVoule%
Application.ScreenUpdating = False
X1 = Sheets("Feuil1").Cells(Rows.Count, "K").End(xlUp).Row '- 1
X2 = Sheets("Feuil2").Cells(Rows.Count, "C").End(xlUp).Row '- 1
X3 = Sheets("Feuil1").Cells(Rows.Count, "G").End(xlUp).Row + 1
xCount = Application.InputBox("Nombre de lignes", "Saf", , , , , , 1)
If xCount < 1 Then
MsgBox "Le nombre de lignes entré est erroné. Veuillez recommencer", vbInformation, "Saf"
GoTo GestionErreur
End If
HauteurVoulue = 33.75
With Sheets("Feuil2")
.Range("A" & X2 & ":K" & X2).Copy
.Range("A" & X2 + 1 & ":A" & X2 + xCount).Insert Shift:=xlDown
.Range("A" & X2 + 1 & ":A" & X2 + xCount).RowHeight = HauteurVoulue ' Hauteur des lignes définie dans la varieble "HauteurVoulue"
' .Range("A" & X2 + 1 & ":A" & X2 + xCount).RowHeight = .Range("A" & X2).RowHeight ' Même hauteur que la ligne copiée
' .Range("A" & X2 + 1 & ":A" & X2 + xCount).Rows.AutoFit ' Adaptation automatique de la hauteur
End With
With Sheets("Feuil1")
.Range("A" & X1 & ":K" & X1).Copy
.Range("A" & X1 + 1 & ":A" & X1 + xCount).Insert Shift:=xlDown
.Range("A" & X1 + 1 & ":A" & X1 + xCount).RowHeight = HauteurVoulue
' .Range("A" & X1 + 1 & ":A" & X1 + xCount).RowHeight = .Range("A" & X1).RowHeight
' .Range("A" & X1 + 1 & ":A" & X1 + xCount).Rows.AutoFit
End With
Application.CutCopyMode = False
GestionErreur:
End Sub