jaffacakeking
Board Regular
- Joined
- Jan 13, 2002
- Messages
- 149
Hi everyone,
i'm using the following code to populate a combobox on a userform;
ComboBox1.RowSource = vbNullString
ComboBox1.RowSource = Range("A1", Range("A65536").End(xlUp)).Address
This works well but i'm having trouble polulating a listbox once the selection has been made. I'd like to have the adjacet cell's text placed in the listbox i.e. if the user selects the text in A2 then i'd like the text from B2 to be added to the list.
I've got an idea in my head but i'm not sure how to phrase it, kind of like...
If combobox1.text = "x" then listbox1.Range("A1 +1", Range("A65536").End(xlUp)).Address.additem
I know i need to refer to either the text or value of the adjacent cell but thats when i get lost.
Thanks for any help!
i'm using the following code to populate a combobox on a userform;
ComboBox1.RowSource = vbNullString
ComboBox1.RowSource = Range("A1", Range("A65536").End(xlUp)).Address
This works well but i'm having trouble polulating a listbox once the selection has been made. I'd like to have the adjacet cell's text placed in the listbox i.e. if the user selects the text in A2 then i'd like the text from B2 to be added to the list.
I've got an idea in my head but i'm not sure how to phrase it, kind of like...
If combobox1.text = "x" then listbox1.Range("A1 +1", Range("A65536").End(xlUp)).Address.additem
I know i need to refer to either the text or value of the adjacent cell but thats when i get lost.
Thanks for any help!