j'ai essayer le macro et il ne fonctionne pas pour les week-end...
Inexact Tu dis n'importe quoi !
Il y avait juste un petit détail, elle ne ramenait pas l'heure à 6h30 le lundi, je viens de le rectifier.
Version rectifiée :
Sub AjusterDateHeure()
Dim tDH(), d, h, js%, k%, i%
With ActiveSheet
k = .Range("B3").End(xlToRight).Column
ReDim tDH(6 To 7, 2 To k)
For i = 2 To k
d = Int(.Cells(3, i)): h = .Cells(3, i) - d
If h < 39 / 144 Then h = 39 / 144
If h > 124 / 144 Then
d = d + 1: h = 39 / 144
End If
js = Weekday(d) Mod 7
If js < 2 Then
d = d + 2 - js: h = 39 / 144
End If
tDH(7, i) = d + h
tDH(6, i) = StrConv(Format(d, "dddd"), vbProperCase)
Next i
With .Range("B6").Resize(2, k - 1)
.Value = tDH
.NumberFormat = "dd/mm/yyyy hh:mm"
End With
End With
End Sub
rectification surlignée
Voilà les résultats fournis par la macro sur ton échantillon :
Et rappel de tes spécifications :
- Si l'heure est comprise entre 00:00 et 06:30 alors il m'affiche 06:30
- Si l'heure dépasse 20:40 alors tu me l'affiche au lendemain 06:30
- En même temps je voudrais que si la date est pointé un week-end il me la pointe au lundi 06:30
Viens donc me dire en quoi la macro ne les respecte pas !