Insérer des lignes entre 2 celulles

Bonjour,

Nous avons un tableau avec 10 colonnes et 1100 lignes.
Nous souhaitons insérer 13 lignes vides entre chaque ligne.
Quel est le code VBA.

D'avance merci pour votre aide.

1 réponse

  1. Modérateur
    Bonjour,

    A adapter :
    Sub InsereLignes()   
    Dim lig As Long, drlig As Long   
    Dim nbLign As Byte, lignDep As Byte   
    Dim NomFeuil As String    
    
    'A ADAPTER ----------------------------------------   
    drlig = Range("A" & Rows.Count).End(xlUp).Row 'dernière ligne col A   
    nbLign = 12 'pour insérer 13 lignes indiquer 12...   
    lignDep = 2 'pour signifier que le tableau commence ligne 1   
    NomFeuil = "Feuil1" 'nom de la feuille concernée   
    'Fin ADAPT------------------------------------------   
    
    Application.ScreenUpdating = False
    With Sheets(NomFeuil)   
        For lig = drlig To lignDep Step -1   
            .Rows(lig & ":" & lig + nbLign).Insert Shift:=xlDown   
        Next lig   
    End With   
    Application.ScreenUpdating = True   
    End Sub 


    Cordialement,
    Franck P
    0