fenec
XLDnaute Impliqué
Bonjour le forum
J’aimerais apporter des modifications à mon code afin qu'il puisse ajouter plus qu'une ligne.
Suis parvenu à mettre un inputbox mais pour le reste je bloque
Cordialement
Philippe
J’aimerais apporter des modifications à mon code afin qu'il puisse ajouter plus qu'une ligne.
Suis parvenu à mettre un inputbox mais pour le reste je bloque
Code:
Sub Ajouter_lignes()
Dim P As Range
Dim nbrLig As Integer
nbrLig = InputBox("Combien de ligne voulez-vous rajouter ?", Title:="Lignes")
If nbrLig = 0 Then
Exit Sub
Else
Set P = Cells(Cells(Rows.Count, 2).End(xlUp).Row - 1, 2).Resize(1, 15)
P.Copy
P.Insert Shift:=xlDown
On Error Resume Next
P.SpecialCells(xlCellTypeConstants).ClearContents
On Error GoTo 0
Application.CutCopyMode = False
Rows(P.Row).RowHeight = 30
Rows(P.Row + 1).RowHeight = 50
Set P = Nothing
End If
Application.ScreenUpdating = True
End Sub
Cordialement
Philippe