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
| Private Sub Ok_Click()
If Personnes.ListIndex = -1 Then
MsgBox "Aucune personne n'est selecitionée !", vbCritical
Exit Sub
End If
If Selection_Taches.ListIndex = 0 Then
MsgBox ("Aucunes n'est tâche(s) selectionnée(s) !"), vbCritical
Exit Sub
End If
If Heures.Value = "" Then
MsgBox ("Vous n'avez mis aucun temps passé !"), vbCritical
Exit Sub
End If
Call Fichier_Taches
Windows("planning taches mensuelles - " & Personnes & ".xlsx").Activate
Application.WindowState = xlMinimized
Dim lItem As Long
For lItem = 0 To Selection_Taches.ListCount - 1
If Selection_Taches.Selected(lItem) = True Then
MsgBox "Information saisie : " & vbLf & vbLf _
& "Personne : " & Personnes & vbLf _
& "Vous avez passé : " & Heures & " heure à faire : " & Selection_Taches.ListIndex.Selected(lItem) & " tâche(s)" & vbLf & vbLf _
& "Soit : " & (Format(Replace(Heures, ".", ","), " 0.00") / Selection_Taches.ListIndex) & vbLf _
& "Pour faire : " & Selection_Taches.List(lItem) _
, vbInformation, "Information"
Sheets("Tâches").Range("A65536").End(xlUp).Offset(1, 0).FormulaR1C1 = Format(Date, "mmm")
Sheets("Tâches").Range("A65536").End(xlUp).Offset(0, 1).FormulaR1C1 = Format(Date, "mm/dd/yyyy")
Sheets("Tâches").Range("A65536").End(xlUp).Offset(0, 2).FormulaR1C1 = Selection_Taches.List(lItem)
Sheets("Tâches").Range("A65536").End(xlUp).Offset(0, 3).FormulaR1C1 = (Format(Heures, " 0.00") / Selection_Taches.ListIndex)
Selection_Taches.Selected(lItem) = False
End If
Next
Windows("planning taches mensuelles - " & Personnes & ".xlsx").Activate
Application.WindowState = xlMinimized
ActiveWorkbook.Save
ActiveWindow.Close
MsgBox "Merci " & Personnes & vbLf & " données saisie !", vbInformation, "Confirmation"
Unload Me
End Sub |
Partager