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
   | 'ajout de donnée dans le tableaux
Public Function newline() As Boolean
    With USFDonnées
        .Show
        If .flag = True Then
            Sheets("Feuil1").ListObjects("Tableau1").ListRows.Add (1)
            Sheets("Feuil1").Cells(5, 1).Resize(1, 4) = Array(.TextBox1.Text, .TextBox2.Text, .TextBox3.Text, .TextBox4.Text)
        End If
        newline = .flag
    End With
    Unload USFDonnées
End Function
'
'
'modifiction des données d'une ligne
Public Function modif_ligne() As Boolean
    Dim pl&, i&
      If Not Intersect(Range(Sheets("Feuil1").ListObjects("Tableau1")), ActiveCell) Is Nothing Then
        pl = ActiveCell.Row
        With USFDonnées
            For i = 1 To 4: .Controls("TextBox" & i).Value = Sheets("Feuil1").Cells(pl, i): Next
            .Show
            If .flag = True Then
                Sheets("Feuil1").Cells(pl, 1).Resize(1, 4) = Array(.TextBox1.Text, .TextBox2.Text, .TextBox3.Text, .TextBox4.Text)
            End If
            modif_ligne = .flag
        End With
        Unload USFDonnées
    End If
End Function | 
Partager