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 76 77 78 79 80 81 82 83
| Sub SauvegardeEtatParcMLA()
' Contrôle d'une sauvegarde du jour dèjà faite
LHeure = Time
If Sheets("Synthèse MLA").Range("AD2").Value = 1 Then
ret = MsgBox("La sauvegarde des données de ce jour a déjà été réalisée à " & Format(LHeure, "hh:mm") & Chr(10) & Chr(10) & " Souhaitez vous continuer ?", vbYesNo + vbInformation)
If ret = vbNo Then
Exit Sub
End If
End If
Sheets("Synthèse MLA").Select
'Désactive la protection de la feuille de synthèse
ActiveSheet.Unprotect "BONSAI"
'Copie les éléments du jour
Range("E2:E21").Select
Selection.Copy
Range("H65000").End(xlUp).Offset(1).Select
Selection.PasteSpecial Paste:=xlPasteValuesAndNumberFormats, Operation:= _
xlNone, SkipBlanks:=False, Transpose:=True
Application.CutCopyMode = False
With Selection
.HorizontalAlignment = xlCenter
.VerticalAlignment = xlBottom
.WrapText = False
.Orientation = 0
.AddIndent = False
.IndentLevel = 0
.ShrinkToFit = False
.ReadingOrder = xlContext
.MergeCells = False
End With
Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.ColorIndex = xlAutomatic
.TintAndShade = 0
.Weight = xlThin
End With
Selection.Borders(xlEdgeBottom).LineStyle = xlNone
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.ColorIndex = xlAutomatic
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.ColorIndex = xlAutomatic
.TintAndShade = 0
.Weight = xlThin
End With
Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
Range("F8").Select
ActiveWindow.SmallScroll ToRight:=9
ActiveWindow.ScrollColumn = 9
ActiveWindow.ScrollColumn = 8
ActiveWindow.ScrollColumn = 7
ActiveWindow.ScrollColumn = 6
ActiveWindow.ScrollColumn = 5
ActiveWindow.ScrollColumn = 4
ActiveWindow.ScrollColumn = 3
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 1
Range("N7").Select
Range("K13").Select
ActiveWindow.SmallScroll Down:=-6
Range("B1").Select
'réactive la protection de la feuille de synthèse
ActiveSheet.Protect "BONSAI", True, True, True
'Active la macro pour la transmission du document par mail
Call TransmissionMailRotation
End Sub |
Partager