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
| Sub Macro1()
'variables
Dim i As Integer
For i = 3 To 22
j = Cells(16, i).Value
If j < 10 Then
Windows("GBanque_Synthèse-Cpte-au-2011-07-0" & j & ".xlsm").Activate
Range("K2:K13").Select
Application.CutCopyMode = False
Selection.Copy
Windows("Reporting2011.xls").Activate
Cells(2, i).Select
ActiveSheet.Paste
End If
If j > 10 Then
Windows("GBanque_Synthèse-Cpte-au-2011-07-" & j & ".xlsm").Activate
Range("K2:K13").Select
Application.CutCopyMode = False
Selection.Copy
Windows("Reporting2011.xls").Activate
Range("C" & i + 1).Select
ActiveSheet.Paste
End If
Next |
Partager