[excel] row selection in listbox
Solved
ced3c
Posted messages
240
Status
Member
-
ced3c Posted messages 240 Status Member -
ced3c Posted messages 240 Status Member -
Hello,
I don't know how to indicate that no line is selected.
Thank you :)
Configuration: Windows 7 / Safari 535.2
I don't know how to indicate that no line is selected.
Private Sub CommandButton4_Click() If ExtraitVente.ListCount = 1 And ExtraitVente.Row.Select = 0 Then MsgBox ("Select a line to delete") ElseIf ExtraitVente.ListCount = 0 Then MsgBox ("No products in the table") Else Me.TextBox4 = Me.TextBox4 - (ExtraitVente.List(ExtraitVente.ListIndex, 5)) Me.TextBox5 = Me.TextBox5 - (ExtraitVente.List(ExtraitVente.ListIndex, 6)) Me.TextBox6 = Me.TextBox6 - (ExtraitVente.List(ExtraitVente.ListIndex, 7)) Me.ExtraitVente.RemoveItem (Me.ExtraitVente.ListIndex) End If End Sub ExtraitVente.Row.Select = 0is indeed false, but I don't know how to express that.
Thank you :)
Configuration: Windows 7 / Safari 535.2
4 answers
-
-
Re up, sorry to "re up" but I'm a bit stuck on this code and I don't know how to proceed at all.
-
Hello
Probably like this:
Private Sub CommandButton4_Click() If ExtraitVente.ListIndex < 0 Then MsgBox ("Select a line to delete") Else Me.TextBox4 = Me.TextBox4 - (ExtraitVente.List(ExtraitVente.ListIndex, 5)) Me.TextBox5 = Me.TextBox5 - (ExtraitVente.List(ExtraitVente.ListIndex, 6)) Me.TextBox6 = Me.TextBox6 - (ExtraitVente.List(ExtraitVente.ListIndex, 7)) Me.ExtraitVente.RemoveItem (Me.ExtraitVente.ListIndex) End If End Sub
--
Always calm -