Bonjour,
Ci-dessous le code sur lequel je sèche
Dans la boucle for je souhaiterais que ColName & i fasse référence à ma variable ColName1 quand i = 1 (c'est à dire la valeur SALORG).
Sub Col_Sort2()
Dim i As Integer
Dim ColName1 As String
Dim ColName2 As String
Dim ColName3 As String
ColName1 = "SALORG"
ColName2 = "NOTI"
ColName3 = "DESC"
For i = 1 To 3
If Cells(1, i).Value <> ColName & i Then
Set Ref = Range("A1:DE1").Find(What:=ColName & i, LookIn:=xlValues, LookAt:=xlWhole)
Intersect(Range("A1").CurrentRegion, Ref.EntireColumn).Select
Selection.Cut
Columns(i).Select
Selection.Insert Shift:=xlToRight
Range("C1").Select
End If
Next
End Sub
Edit modo : code à mettre entre balises avec le bouton </> merci d'y faire attention la prochaine fois
Comment faire?
Merci pour votre support