Sub ajout_colonne_SKU()
Dim idx1, idx2, idx3
Dim derLig As Long
With ActiveSheet
idx1 = Application.Match("Modele", .Range("1:1"), 0)
idx2 = Application.Match("code_coloris", .Range("1:1"), 0)
idx3 = Application.Match("taille", .Range("1:1"), 0)
If Not IsError(idx1) And Not IsError(idx2) And Not IsError(idx3) Then
.Columns(1).Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
.Cells(1, 1).Select
ActiveCell = "SKU"
derLig = .Cells(.Rows.Count, 1).End(xlUp).Row
.Cells(2, 1).Resize(derLig).Formula = "=CONCATENATE(" & .Cells(2, idx1).Address(0, 0) & "," & .Cells(2, idx2).Address(0, 0) & "," & .Cells(2, idx3).Address(0, 0) & ")"
Else
MsgBox "Verifier que les entêtes de colonnes: 'Modele', 'code_coloris' et 'taille' sont bien en ligne 1 et recommencez!", vbExclamation, "Ajout_colonne_SKU"
End If
End With
End Sub