rajkumar1989
New Member
- Joined
- Apr 24, 2014
- Messages
- 1
Hi
I have Created a excel user form with three Combo box and list box with 3 columns.
When user selects a value from drop down list and click Add button it will be displayed in the list box - Done
When user selects a item in the list box it will again displays in drop down list - done
But when user selects the item in the list box and click update button its calling the ListBox _click () function, I dont want it to call the listbox_click fuction
PLease help. updating the code
Code for adding value from drop down list to list box
<code style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; white-space: inherit;">
</code>
when user clicks the item in the list box it will display the value in drop down list
when user click the update button code.
when it goes to lstValues.Column(j) = cboPpayTier.Value line its calling the lstValues_Click() fuction I dont want code to call that fuction. Please Help
please let me for more clarification.. thanks in advance
I have Created a excel user form with three Combo box and list box with 3 columns.
When user selects a value from drop down list and click Add button it will be displayed in the list box - Done
When user selects a item in the list box it will again displays in drop down list - done
But when user selects the item in the list box and click update button its calling the ListBox _click () function, I dont want it to call the listbox_click fuction
PLease help. updating the code
Code for adding value from drop down list to list box
<code style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; white-space: inherit;">
Code:
[COLOR=#00008B]Private [/COLOR][COLOR=#00008B]Sub[/COLOR] cmdAdd_Click()
[COLOR=#00008B]Call[/COLOR] stValues.AddItem(AddPpayTierOption(cboPpayTier.Value))
lstValues.List(UBound(lstValues.List), COL_BRAND) = cboBrandTier.Value
lstValues.List(UBound(lstValues.List), COL_GEN) = cboGenTier.Value
[COLOR=#00008B]End[/COLOR] [COLOR=#00008B]Sub[/COLOR]
when user clicks the item in the list box it will display the value in drop down list
Code:
<code style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; white-space: inherit;">[COLOR=#00008B]Private[/COLOR] [COLOR=#00008B]Sub[/COLOR] lstValues_Click()
[COLOR=#00008B]Dim[/COLOR] I [COLOR=#00008B]As[/COLOR] [COLOR=#00008B]Long
[/COLOR]cmdEdit.Enabled = [COLOR=#800000]True
[/COLOR]cmdRemove.Enabled = [COLOR=#800000]True[/COLOR]
[COLOR=#00008B]If[/COLOR] lstValues.ListIndex <> -[COLOR=#800000]1[/COLOR] [COLOR=#00008B]Then[/COLOR]
[COLOR=#00008B]For[/COLOR] I = [COLOR=#800000]0[/COLOR] [COLOR=#00008B]To[/COLOR] lstValues.ColumnCount - [COLOR=#800000]1[/COLOR]
[COLOR=#00008B]If[/COLOR] I = [COLOR=#800000]0[/COLOR] [COLOR=#00008B]Then[/COLOR]
cboPpayTier.Value = lstValues.Column(I)
[COLOR=#00008B]Else[/COLOR]
[COLOR=#00008B]If[/COLOR] I = [COLOR=#800000]1[/COLOR] [COLOR=#00008B]Then[/COLOR]
cboBrandTier.Value = lstValues.Column(I)
[COLOR=#00008B]Else[/COLOR]
[COLOR=#00008B]If[/COLOR] I = [COLOR=#800000]2[/COLOR] [COLOR=#00008B]Then[/COLOR]
cboGenTier.Value = lstValues.Column(I)
[COLOR=#00008B]End[/COLOR] [COLOR=#00008B]If[/COLOR]
[COLOR=#00008B]End[/COLOR] [COLOR=#00008B]If[/COLOR]
[COLOR=#00008B]End[/COLOR] [COLOR=#00008B]If[/COLOR]
[COLOR=#00008B]Next[/COLOR] I
[COLOR=#00008B]End[/COLOR] [COLOR=#00008B]If
[/COLOR]</code>[COLOR=#000000][FONT=Arial]End Sub[/FONT][/COLOR]
when user click the update button code.
when it goes to lstValues.Column(j) = cboPpayTier.Value line its calling the lstValues_Click() fuction I dont want code to call that fuction. Please Help
Code:
<code style="margin: 0px; padding: 0px; border: 0px; vertical-align: baseline; font-family: Consolas, Menlo, Monaco, 'Lucida Console', 'Liberation Mono', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif; white-space: inherit;">[COLOR=#00008B]Private[/COLOR] [COLOR=#00008B]Sub[/COLOR] cmdEdit_Click()
[COLOR=#00008B]Dim[/COLOR] j [COLOR=#00008B]As[/COLOR] [COLOR=#00008B]Long[/COLOR][COLOR=#00008B]Dim[/COLOR] var [COLOR=#00008B]As[/COLOR] [COLOR=#00008B]Variant[/COLOR]
[COLOR=#00008B]If[/COLOR] lstValues.ListIndex <> -[COLOR=#800000]1[/COLOR] [COLOR=#00008B]Then[/COLOR]
[COLOR=#00008B]For[/COLOR] j = [COLOR=#800000]0[/COLOR] [COLOR=#00008B]To[/COLOR] lstValues.ColumnCount - [COLOR=#800000]1[/COLOR]
[COLOR=#00008B]If[/COLOR] j = [COLOR=#800000]0[/COLOR] [COLOR=#00008B]Then[/COLOR]
lstValues.Column(j) = cboPpayTier.Value
[COLOR=#00008B]Else[/COLOR]
[COLOR=#00008B] If[/COLOR] j = [COLOR=#800000]1[/COLOR] [COLOR=#00008B]Then[/COLOR]
lstValues.Column(j) = cboBrandTier.Value
[COLOR=#00008B]Else[/COLOR]
[COLOR=#00008B]If[/COLOR] j = [COLOR=#800000]2[/COLOR] [COLOR=#00008B]Then[/COLOR]
lstValues.Column(j) = cboGenTier.Value
[COLOR=#00008B]End[/COLOR] [COLOR=#00008B]If[/COLOR]
[COLOR=#00008B]End[/COLOR] [COLOR=#00008B]If[/COLOR]
[COLOR=#00008B]End[/COLOR] [COLOR=#00008B]If[/COLOR]
[COLOR=#00008B]Next[/COLOR] j
[COLOR=#00008B]End[/COLOR] [COLOR=#00008B]If
[/COLOR][COLOR=#00008B]End[/COLOR] [COLOR=#00008B]Sub
[/COLOR]</code>
please let me for more clarification.. thanks in advance