1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
| Private Sub CommandButton1_Click()
Dim I As Integer
Cells.Select
Selection.Sort Key1:=Range("A1"), Order1:=xlAscending, Key2:=Range("Q1") _
, Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase:= _
False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal, DataOption2 _
:=xlSortNormal
Range("B9").Select
I = 1
Do While Sheets("21)Contrôle").Cells(I, 1) <> ""
Rows(I).Insert Shift:=xlDown
I = I + 2
Loop
Workbooks.Open ("C:\Documents and Settings\RICOH\Mes documents\version\Classeur1.xls")
Windows("Classeur1.xls").Activate
Range("A1:R18").Select
Selection.Copy
Windows("test2.xls").Activate
Rows("1:1").Select
Range("B1").Activate
Selection.Insert Shift:=xlDown
Windows("Classeur1.xls").Close
End Sub |