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
| Sub ENGTS_INTERNE_HEBDO_GLOBAL()
Dim NoSemaine, Rs, I As Integer, J As Integer, C As Range, Plage As Range, col
Dim Sh As Worksheet
Dim Ws As Worksheet
Dim DebSem As String
Dim FindSem
Dim FindJour As Range
NoSemaine = Sheets("ACCUEIL").Range("E18")
DebSem = Format(Sheets("ACCUEIL").Range("E20").Value, "dd/mm/yyyy")
'ATL PRO Global
Set Ws = ActiveWorkbook.Sheets("PRO_ENG_QUOTI")
Set Sh = ActiveWorkbook.Sheets("PRO_ENG_HEBDO")
With Ws
Set FindJour = .Range("C46", "ND86").Find(What:=DebSem, After:=ActiveCell, LookIn:=xlValues, _
LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False)
col = FindJour.Column
End With
Set Plage = Range(Cells(46, col), Cells(46, col + 6))
With Sh.Rows(45)
Set FindSem = .Find(NoSemaine, , xlValues, xlWhole, xlByColumns)
End With
With Ws
For Each C In Plage
For J = 47 To 48
'MsgBox Plage.Address
MsgBox Sh.Cells(J, FindSem.Column).Address
MsgBox Ws.Cells(J, C.Column).Value
Sh.Cells(J, FindSem.Columnn) = Sh.Cells(J, FindSem.Columnn) + Ws.Cells(J, C.Column).Value
Next J
Next C
End With
End Sub |
Partager