Insertion automatique de colonnes

Fermé
pantano13 - 12 déc. 2016 à 11:29
yg_be Messages postés 22846 Date d'inscription lundi 9 juin 2008 Statut Contributeur Dernière intervention 3 juin 2024 - 12 déc. 2016 à 20:25
Bonjour,

J'ai un gros tableau de données (A1:XU450) et je doit y insérer un colonnes toutes les 3 colonnes.
Exemple insertion en colonne C; colonne F; colonne I etc...
Comment faire?
merci de m'aider



1 réponse

yg_be Messages postés 22846 Date d'inscription lundi 9 juin 2008 Statut Contributeur Dernière intervention 3 juin 2024 1 473
12 déc. 2016 à 20:25
Je propose ceci:
Option Explicit
Sub pantano13()
Dim numcol As Long
Dim n As Integer
n = 0
numcol = 1
Do While Cells(1, numcol) <> ""
    n = n + 1
    If n = 3 Then
        Cells(1, numcol).EntireColumn.Insert
        n = 1
        numcol = numcol + 1
    End If
    numcol = numcol + 1
Loop 'Do While Cells(1, numcol) <> ""
End Sub
0