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
|
Sub eau_douce()
If Sheets("RELEVES").Range("$I$1") > Sheets("Conso eau douce").Range("A" & Range("A65500").End(xlUp).Row) Then
' Date Suppérieur
Sheets("RELEVES").Select
Range("$I$1").Select
Selection.Copy
Sheets("Conso eau douce").Select
Range("A" & Range("A65500").End(xlUp).Row + 1).Select
ActiveSheet.Paste
Sheets("RELEVES").Select
Range("$K$14").Select
Selection.Copy
Sheets("Conso eau douce").Select
Range("B" & Range("B65500").End(xlUp).Row + 1).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Sheets("Conso eau douce").Select
Cells(56000, 3).End(xlUp).Select
Selection.Copy
Range("C" & Range("C65500").End(xlUp).Row + 1).Select
ActiveSheet.Paste
Else
' Date identique
Sheets("RELEVES").Select
Range("$I$1").Select
Selection.Copy
Sheets("Conso eau douce").Select
Cells(56000, 1).End(xlUp).Select
ActiveSheet.Paste
Sheets("RELEVES").Select
Range("$K$14").Select
Selection.Copy
Sheets("Conso eau douce").Select
Cells(56000, 2).End(xlUp).Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
End If
Sheets("Conso eau douce").Select
Columns("A:A").Select
Selection.NumberFormat = "mmm-yy"
With Selection
.HorizontalAlignment = xlRight
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Range("I75").Select
ActiveWorkbook.Save
End sub |
Partager