Private Sub CB_OK_Click()
HA = CDec(TB_HA) & ":" & CDec(TB_MA)
HD = CDec(TB_HF) & ":" & CDec(TB_MF)
With Sheets("base de donnees")
Set c = .Range("A" & .Cells(.Rows.Count, 1).End(xlUp).Row)(2)
'y mettre le nom
c.Value = CDec(Lab_Mois) & "/" & CDec(TB_Jour) & "/" & CDec(TB_Annee)
c(1, 2) = CDec(Lab_Mois) & "/" & CDec(TB_Jour) & "/" & CDec(TB_Annee)
c(1, 3).FormulaR1C1 = "=IF(WEEKDAY(RC4,2)=7,""Dimanche"",IF(ISNA(VLOOKUP(RC[1],JoursFerie,1,FALSE)),""Normal"",""Férié""))"
c(1, 4) = CDec(Lab_Mois) & "/" & CDec(TB_Jour) & "/" & CDec(TB_Annee)
If Lab_Nom = "" Then
MsgBox "Veuillez sélectionner un Nom"
Else
c(1, 5) = Lab_Nom
End If
c(1, 6) = HA 'CDec(TB_HA) & ":" & CDec(TB_MA)
c(1, 7) = HD 'CDec(TB_HF) & ":" & CDec(TB_MF)
c(1, 8).FormulaR1C1 = "=IF(MOD(RC[-1]-RC[-2],1)>R1C36,R1C34,0)" 'Pause
c(1, 9).FormulaR1C1 = "=IF(OR(WEEKDAY(RC[-5],2)=7,RC[-6]=""Férié""),RC[1],IF(RC[-2]>R1C38,MOD(MIN(RC[-2],R1C40)-MAX(RC[-3],R1C38),1),""""))"
c(1, 10).FormulaR1C1 = "=IF(RC[-3]="""","""",MOD(RC[-3]-RC[-4],1)-RC[-2])"
c(1, 11).FormulaR1C1 = "=IF(RC[-2]="""",RC[-1],RC[-2]+RC[-1])"
Call Cadre
End With
End Sub
Sub Cadre()
'
' Cadre Macro
'
'
[COLOR="#FF0000"]Range(Cells(1, 1), Cells(1, 11)).Select[/COLOR] Selection.Borders(xlDiagonalDown).LineStyle = xlNone
Selection.Borders(xlDiagonalUp).LineStyle = xlNone
With Selection.Borders(xlEdgeLeft)
.LineStyle = xlContinuous
.ColorIndex = xlAutomatic
.TintAndShade = 0
.Weight = xlMedium
End With
With Selection.Borders(xlEdgeTop)
.LineStyle = xlContinuous
.ColorIndex = xlAutomatic
.TintAndShade = 0
.Weight = xlThin
End With
With Selection.Borders(xlEdgeBottom)
.LineStyle = xlContinuous
.ColorIndex = xlAutomatic
.TintAndShade = 0
.Weight = xlMedium
End With
With Selection.Borders(xlEdgeRight)
.LineStyle = xlContinuous
.ColorIndex = xlAutomatic
.TintAndShade = 0
.Weight = xlMedium
End With
With Selection.Borders(xlInsideVertical)
.LineStyle = xlContinuous
.ColorIndex = xlAutomatic
.TintAndShade = 0
.Weight = xlThin
End With
Selection.Borders(xlInsideHorizontal).LineStyle = xlNone
End Sub