Re : modifier une base de données
salut Nrdz
ajout d'un test si sélection dans combobox1,derlig=index+2,sinon derlig=derligne+1
les textbox13,15,17 propriété enabled=false
userform F_supprArticle
Private Sub FB_Valider_Click()
Dim Lig As Long
If ActiveCell.Row > 1 Then
Lig = ActiveCell.Row
Range("A" & Lig & ":T" & Lig).Select
Selection.Delete Shift:=xlUp
End If
Unload F_supprArticle
End Sub
Private Sub UserForm_Initialize()
'USF_ficheperso
TB_13.Enabled = False
TB_15.Enabled = False
TB_17.Enabled = False
End Sub
Private Sub Bn_modifications_Click()
Dim DerLig As Integer
'USF_ficheperso
With Sheets("base de données")
If ComboBox1.Value <> "" Then
DerLig = ComboBox1.ListIndex + 2
Else: DerLig = Range("A" & Rows.Count).End(xlUp).Row + 1
End If
.Cells(DerLig, 1) = TB_2
.Cells(DerLig, 2) = TB_3
.Cells(DerLig, 3) = TB_7
.Cells(DerLig, 4) = TB_8
.Cells(DerLig, 5) = Format(Val(TB_1), "0#"" ""##"" ""##"" ""##"" ""##")
.Cells(DerLig, 6) = TB_9
.Cells(DerLig, 7) = TB_10
.Cells(DerLig, 8) = TB_11
.Cells(DerLig, 9) = TB_12
' .Cells(DerLig, 10) = TB_13
.Cells(DerLig, 12) = TB_14
' .Cells(DerLig, 13) = TB_15
.Cells(DerLig, 15) = TB_16
' .Cells(DerLig, 16) = TB_17
.Cells(DerLig, 18) = TB_4
.Cells(DerLig, 19) = TB_5
.Cells(DerLig, 20) = TB_6
End With
' On décharge le formulaire
Unload Me
End Sub
à bientôt