Microsoft 365 Contrôles Validation Formulaire

mld.sebastien

XLDnaute Junior
Bonjour,

Je cherche à finir ma Box_CLoture pour le contrôle des champs pour certaine information et vérifie si déjà clos ou pas à la validation de mon formulaire.
J'ai commencé mais je bloque sur la partis véfication dans le tableau si déjà clos.

VB:
Private Sub Cmd_Cloture_Click()
Dim Ln As Long
    If Me.TxtDateCloture = "" Then
        'TxtDateCloture.BackColor = RGB(255, 0, 0)
        MsgBox "Merci d'indiquer la date"
        TxtDateCloture.SetFocus
        Exit Sub
    
   ' ElseIf IsDate(Me.TxtDateCloture) = False Then
   '     MsgBox ("La date n'est pas correcte")
   '     TxtDateCloture.SetFocus
   ' Exit Sub
  
    ElseIf Sheets("EVT-MUSE").Range("R3").Value = "clos" Then
        'TxtDateCloture.BackColor = RGB(255, 0, 0)
        MsgBox "Deja cloturer"
        Sheets("EVT-MUSE").Range("R3").SetFocus
        Exit Sub

    
    
        With Sheets("evt-muse")
            Ln = ActiveCell.Row
            If IsDate(TxtDateCloture) Then .Cells(Ln, 19) = CDate(TxtDateCloture) '***'

            .Cells(Ln, 20) = Lst_Intervenant & " " & Text_Cloture_Description.Value
            .Cells(Ln, 18) = "clos"
            .Cells(Ln, 18).Interior.Color = RGB(146, 208, 80)
            .Cells(Ln, 18).Font.Bold = True

        End With
    End If
    Sheets("DONNEE_MACRO").Range("D25").Value = IsDate(TxtDateCloture)
    
   MsgBox "La cloture a été prise en compte."
  
      Text_NMR.Value = ""
      TxtDateCloture = ""
      Text_Cloture_Description = ""
      Lst_Intervenant.Value = ""
End Sub
 

mld.sebastien

XLDnaute Junior
Je viens de trouver la solution pour récupérer la totalité de clos et en cours dans un tableau onglet préface :
Le code ce trouve dans BOX_CREATION_EVT :

VB:
Private Sub UserForm_Initialize()
    With Sheets("EVT-MUSE").ListObjects("t_EvtMuse")
        LastLine = .ListRows.Count
    'Lst_Intervenant.List = Range("t_Trigramme").ListObject.DataBodyRange.Value
    Lst_Intervenant.List = Range("t_Trigramme[Lst_Intervenant]").Value
    Lst_demande.List = Range("t_Demande").ListObject.DataBodyRange.Value
   
    'MsgBox (.ListColumns(1).DataBodyRange(LastLine))
   
'*******************************
    ' Nombre En cours Clos du Total Tableau
    Sheets("Préface").Range("D4").Value = WorksheetFunction.CountIf(Sheets("EVT-MUSE").Range("R:R"), "En cours")
    Sheets("Préface").Range("E4").Value = WorksheetFunction.CountIf(Sheets("EVT-MUSE").Range("R:R"), "Clos")
    Sheets("Préface").Range("C4").Value = WorksheetFunction.CountIf(Sheets("EVT-MUSE").Range("R:R"), "En cours") + WorksheetFunction.CountIf(Sheets("EVT-MUSE").Range("R:R"), "Clos")
    Sheets("Préface").Range("C8").Value = WorksheetFunction.CountIf(Sheets("EVT-MUSE").Range("C:C"), Date)
'*******************************

    End With
End Sub

Mais pour la quantité de clos et en cours dans le mois je suis perdu.

Quand pensez-vous et pourriez-vous m'aider ?
 

Pièces jointes

  • EVT 2023.xlsm
    72.5 KB · Affichages: 2
Dernière édition:

Statistiques des forums

Discussions
311 725
Messages
2 081 949
Membres
101 852
dernier inscrit
dthi16088