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 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
| Sub STAT()
'
' STAT Macro
'
'
ChDir "C:\Users\mega-pc\Desktop\MACROS EXCEL"
Workbooks.Open Filename:= _
"C:\Users\mega-pc\Desktop\MACROS EXCEL\STAT BBE.xlsx"
Dim derligne As Integer
Dim derlign As Integer
derligne = Worksheets("Feuil1").Range("B65536").End(xlUp).Row
Range("B7:V10").Copy
Sheets("Feuil1").Range("B" & derligne + 2).PasteSpecial Paste:=xlPasteAllUsingSourceTheme, Operation:=xlNone _
, SkipBlanks:=False, Transpose:=False
derlign = Worksheets("Feuil1").Range("C65536").End(xlUp).Row
Range("C" & derlign - 3 & ":C" & derlign).Value = Date
Range("E" & derlign - 3 & ":F" & derlign).ClearContents
Windows("TEST.xls").Activate
Range("B73:C76").Select
Selection.Copy
Windows("STAT BBE.xlsx").Activate
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("H" & derlign - 3 & ":I" & derlign).ClearContents
Windows("TEST.xls").Activate
Range("D73:E76").Select
Application.CutCopyMode = False
Selection.Copy
Windows("STAT BBE.xlsx").Activate
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("K" & derlign - 3 & ":L" & derlign).ClearContents
Windows("TEST.xls").Activate
Range("F73:G76").Select
Application.CutCopyMode = False
Selection.Copy
Windows("STAT BBE.xlsx").Activate
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("N" & derlign - 3 & ":O" & derlign).ClearContents
Windows("TEST.xls").Activate
Range("H73:I76").Select
Application.CutCopyMode = False
Selection.Copy
Windows("STAT BBE.xlsx").Activate
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("Q" & derlign - 3 & ":R" & derlign).ClearContents
Windows("TEST.xls").Activate
Range("J73:K76").Select
Application.CutCopyMode = False
Selection.Copy
Windows("STAT BBE.xlsx").Activate
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("T" & derlign - 3 & ":U" & derlign).ClearContents
Windows("TEST.xls").Activate
Range("L73:M76").Select
Application.CutCopyMode = False
Selection.Copy
Windows("STAT BBE.xlsx").Activate
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("A1").Select
Windows("TEST.xls").Activate
ActiveWindow.SmallScroll Down:=-78
Range("A1:H2").Select
End Sub |
Partager