Function SemJourNuit(Ligne%, R%) ' R=1 remonte Jour/Nuit R=0 remonte N° de semaine
Application.Volatile
For L = Ligne To 1 Step -1
If Cells(L, "A").MergeCells Then
If R = 1 Then
If Cells(L, "A") Like "*Nuit*" Then SemJourNuit = "Nuit" Else SemJourNuit = "Jour"
Else
SemJourNuit = Val(Format(CDate(Split(Cells(L, "A"), " ")(2)), "WW"))
End If
Exit For
End If
Next L
End Function