1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
| Sub SelectionnerColonnes(ColonneDebut As String, ColonneFin As String, ColonnesPaires As Boolean)
Dim ColNumDebut As Integer
Dim i As Integer
Dim Chaine As String
ColNumDebut = Range(ColonneDebut & "1").Column
If ColNumDebut Mod 2 <> 0 And ColonnesPaires Then ColNumDebut = ColNumDebut + 1
For i = ColNumDebut To Range(ColonneFin & "1").Column Step 2
Chaine = Chaine & Split(Cells(1, i).Address, "$")(1) & ":" & Split(Cells(1, i).Address, "$")(1) & ","
Next i
Chaine = Left(Chaine, Len(Chaine) - 1)
Range(Chaine).Select
End Sub
Sub Test()
SelectionnerColonnes "E", "O", True
End Sub |