View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Per Jessen Per Jessen is offline
external usenet poster
 
Posts: 1,533
Default Some expert help needed

Hi Kirk,

RowSource is as you say used to load a listbox with values. Control Source
will hold the selected value, and will also be the selected value next time
the userform is activated.

frmTest.ListBox1.RowSource = "Test!A1:I5"
frmTest.ListBox1.ControlSource="Test!K1"

Hopes this helps.

//Per


"kirkm" skrev i meddelelsen
...
On Wed, 3 Jun 2009 12:07:24 +0100, "Howard31"
wrote:

If P3 has the value 6, then the value of the control will be 6.


By 'value of the control' what do you mean? The list Box itself ?
Wouldn't that depend on the selected row ?


Let say you
have ListBox control and the ControlSource is P6 then the ListBox will
have
one item with the value 6, if the ControlSource will be Sheet1!P3:P12 then
the list will have 10 items containing the values of P3:P12.

Hope this explains it.


Sorry, no... isn't thats whatRowSource does e.g.

frmTest.ListBox1.RowSource = "Test!A1:I5"

That seems to work for me... but I'm not sure of anything anymore :)

Although is something to do with the number of columns in a List Box?
I have 5 or 6 columns... also Control Source Help says CELL or FIELD
singular.

Cheers - Kirk