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 84 85 86 87 88 89 90 91
|
Option Explicit
Option Base 1
Sub archiveRow(myRow As Long)
' **************************************************************************************
' Author : Christian CROCHE
' Date : 31/07/2019
' Description : Ajouter un "x" ou "X" dans la colonne M lance une copie de la ligne
' dans la feuille Tâches réalisées et supprime la ligne de la feuille Travail
' **************************************************************************************
Dim myVariable As String, modeDebug As Boolean
modeDebug = False
If Not modeDebug Then
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
End If
' Comment
If modeDebug Then Stop
Sheets("Rétro planning").Select
Range("B" & myRow & ":F" & myRow).Copy
Sheets("Tâches réalisées").Select
Range("B100000").End(xlUp).Offset(1, 0).Select
Selection.PasteSpecial (xlPasteFormulasAndNumberFormats)
Cells(Selection.Row, 1) = Date
Sheets("Rétro planning").Select
Application.EnableEvents = False
Range("A" & myRow & ":F" & myRow).Delete Shift:=xlShiftUp
Application.EnableEvents = True
If Not modeDebug Then
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
End If
End Sub
Sub recoverRow(myRow As Long)
' **************************************************************************************
' Author : Christian CROCHE
' Date : 01/08/2019
' Description : Ajouter un "x" ou "X" dans la colonne M lance une copie de la ligne
' dans la feuille Travail et supprime la ligne de la feuille Archive
' **************************************************************************************
Dim myVariable As String, modeDebug As Boolean
modeDebug = False
If Not modeDebug Then
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
End If
' Comment
If modeDebug Then Stop
Sheets("Tâches réalisées").Select
Range("B" & myRow & ":F" & myRow).Copy
Sheets("Rétro planning").Select
Range("B100000").End(xlUp).Offset(1, 0).Select
Selection.PasteSpecial (xlPasteFormulasAndNumberFormats)
Sheets("Tâches réalisées").Select
Application.EnableEvents = False
Cells(myRow, 1).EntireRow.Delete Shift:=xlShiftUp
Application.EnableEvents = True
' Tri personnalisé
Range("A4:F111").Select
ActiveWorkbook.Worksheets("Rétro planning").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Rétro planning").Sort.SortFields.Add2 Key:=Range( _
"B4:B111"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
xlSortNormal
With ActiveWorkbook.Worksheets("Rétro planning").Sort
.SetRange Range("A4:F111")
.Header = xlGuess
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
'Fin du tri
If Not modeDebug Then
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
End If
End Sub |
Partager