Transfering text in listbox to a cell

  • Thread starter Thread starter PaulC
  • Start date Start date
P

PaulC

I am new to using ListBoxes. I have a list box, 'Starthrs' which use
the row source property to take values from a column off a worksheet
All I want to do is then transfer the chosen value to another cell o
the same sheet.
But Starthrs.Text does not return the chosen value. What do I need t
do?

Thanks,

Pau
 
Paul,

Set the ControlSource to the cell you want to transfer it to.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
Thanks Bob

I now understand the Control Source property. However, what I now nee
to do is take the value from the listbox and combine with a colon an
another list box (Startmins) value to give for example 10:20.

I had this working before using a combobox by extracting the text fro
the two combo boxes:

Starttime = Starthrs.Text & ":" & Startmins.Text

This will not now work when I change to a listbox. Do I need to chang
any of the properties on the list box, or is there another reason fo
it not working?

(Sorry, should have asked this in the first place)

Pau
 
Paul,

Why not just concatenate the 2 cells that the 2 listboxes are linked to via
the Controlsource property, like

= A1 & ":" & B1

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 
To find out what value is selected in a listbox, you need to refer to the listindex property. To see what the value is of the listindex, you need to specify that index in the List property

So

ListBox1.List(ListBox1.ListIndex) returns the "Text" of the selected value

If it's a MultiSelect Listbox, make sure you read about the Selected property of the ListBox in the Help File, as the above will not work

-Bra
 
No, you can either link it to a cell and read that or get the Value
property.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

Brad Vontur said:
To find out what value is selected in a listbox, you need to refer to the
listindex property. To see what the value is of the listindex, you need to
specify that index in the List property.
So:

ListBox1.List(ListBox1.ListIndex) returns the "Text" of the selected value.

If it's a MultiSelect Listbox, make sure you read about the Selected
property of the ListBox in the Help File, as the above will not work.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top