Re : FormulaArray
dans la feuil année colonne A les données doivent être sous la forme {date}
et la ce n'est pas le cas malgré la commande FormulaArray en VBA
Private Sub cmdok_Click()
Dim i, j, T, c, ctrl, k, p, q, o
Dim jour, client, madoo, materiel
If TxtDate.Value = "" Then
MsgBox ("Il faut indiquer la date !")
Exit Sub
Else
End If
For Each ctrl In UserForm2.Frclient.Controls
k = k + ctrl.Value
Next ctrl
If k = 0 Then
MsgBox ("vous devez choisir ok ou non ok.")
Me.Frclient.SetFocus
Exit Sub
End If
For Each ctrl In UserForm2.Frclient.Controls
If ctrl.Value = True Then client = client & " " & Trim(ctrl.Caption)
Next ctrl
For Each ctrl In UserForm2.Frmadoo.Controls
i = i + ctrl.Value
Next ctrl
If i = 0 Then
MsgBox ("vous devez choisir ok ou non ok.")
Me.Frmadoo.SetFocus
Exit Sub
End If
For Each ctrl In UserForm2.Frmadoo.Controls
If ctrl.Value = True Then madoo = madoo & " " & Trim(ctrl.Caption)
Next ctrl
For Each ctrl In UserForm2.Frmat.Controls
j = j + ctrl.Value
Next ctrl
If j = 0 Then
MsgBox ("vous devez choisir ok ou non ok.")
Me.Frmat.SetFocus
Exit Sub
End If
For Each ctrl In UserForm2.Frmat.Controls
If ctrl.Value = True Then materiel = materiel & " " & Trim(ctrl.Caption)
Next ctrl
For Each q In UserForm2.frjour.Controls
If q.Value = True Then jour = Trim(q.Caption)
Next q
If optmatin = False And optam = False And optjournée = False Then
MsgBox ("vous devez choisir matin, aprés midi ou journée.")
Me.frjour.SetFocus
Exit Sub
End If
num = Sheets("année").Range("A65536").End(xlUp).Row + 1
Sheets("année").Activate
Range("A" & num).FormulaArray = TxtDate
Range("B" & num).Value = jour
Range("c" & num).Value = cbonom
Range("D" & num).Value = client
Range("e" & num).Value = madoo
Range("f" & num).Value = materiel
Range("g" & num).Value = Txtpresta
Range("h" & num).Value = Txtcom
Unload UserForm2
UserForm2.Show
End Sub