RowSource command

B

bjorn

I have a Row Source which is working quite well, however I have tw
columns.
I require that when I select, both of them are showed, for example A
and B2 show next to each other with a comma (,)
 
P

Patrick Molloy

you' need either to add a third column c, where c1:= =A1 & "," & B1
then set your rowsource to column C
OR
don't set the rowsource , but load the listbox on the form's initialise
routine

for each cell in range("Aa:A12358")
listbox1.AddItem cell.value & "," & cell.offset(,1).value
next
 
B

bjorn

I am quite new... I didn't quite understand this.

How am I to create the sum? Using for each cell in A = (a1, b12358)...

or initialise?

Is it possible to help me abit more please
 
P

Patrick Molloy

I assume you have a userform with a listbox control?

then in then simply add this code

Private Sub UserForm_Initialize()
For Each cell In Range("Aa:A12358")
listbox1.AddItem cell.Value & "," & cell.Offset(, 1).Value
Next
End Sub
 
Top