combobox, 2 listbox's and a text box

technix

Active Member
Joined
May 19, 2002
Messages
326
I have a Userform with a listbox that I would like to populate using a textbox on the same form, the combo box is on a different userform and needs to be populated by the items in the listbox. On my userform with the 2 listbox's and the textbox the 2nd listbox is to be populated by selecting items in the first listbox and then pressing a command button however if they select the items in listbox 2 and press a command button it places the selections back in listbox 1 and removes the from listbox 2.

Now that I have painted the picture could you help me with what items in the help should I look up to accomplish this task.

If you need need a screen shot of the form to get the picture or need more help please do not hesitate to ask me.

Derrick
 
On 2002-08-31 00:49, Ivan F Moala wrote:

Derrick, how are you adding the items to the listbox?
If a load time then you should also load the combobox the same...ussing the sam method = Additem

I am adding the items to the listbox1 using a textbox and the following code

Code:
Private Sub Add_Click()
ListBox1.AddItem (TextBox1.Value)
TextBox1.Value = Empty
TextBox1.SetFocus
End Sub

I would like to find a way to do the following. When I unload the userform with the listbox have the list in listbox1 be on a worksheet and also be in a combobox on another userform, Then using something like

Code:
Private Sub UserForm_Initialize()

ListBox1.List = Sheets("Setup").Range("c65536").end(xlup
End Sub

to repopulate listbox1 and be able to use the textbox to add to it when I reload it when needed.

Does this make sense? I can email it to you if you think that may help

Derrick



_________________
Http://www.cashglow.com/affiliates/technix
This message was edited by technix on 2002-08-31 01:04
 
Upvote 0

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
On 2002-08-31 05:19, Ivan F Moala wrote:
Email workbook......

Ivan,

I have emailed the workbook however, I made this change to the sales_maint form

Code:
Private Sub UserForm_Initialize()

Dim cell As Range
Dim ws As Worksheet
Dim NmRng As Range
Set ws = ThisWorkbook.Sheets("Setup")
Set NmRng = ws.Range("c2", ws.Range("c2").End(xlDown))
For Each cell In NmRng
       ListBox1.AddItem cell.Text
Next cell
End Sub

This will fill the listbox with what is in that range now I need to get it to update that range when the listbox is changed

Derrick
 
Upvote 0

Forum statistics

Threads
1,215,465
Messages
6,124,977
Members
449,200
Latest member
Jamil ahmed

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top