text in listbox

B

Bill

Hello,
When using a listbox in a userform, I can insert a number into the worksheet indicating the position of the item I selected, however, I wanted to insert the actual text. I was reading about the .list & .listindex options, but I am not having much luck. I am using Excel 2000. What is the code that would insert the actual text from the userform into the worksheet. My text is in this form "May 03".
thanks in advance
Bill
 
C

Chip Pearson

Bill,

Try something like

With UserForm1.ListBox1
If .ListIndex >= 0 Then
Range("A1").Value = .List(.ListIndex)
End If
End With


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com (e-mail address removed)


Bill said:
Hello,
When using a listbox in a userform, I can insert a number into the
worksheet indicating the position of the item I selected, however, I wanted
to insert the actual text. I was reading about the .list & .listindex
options, but I am not having much luck. I am using Excel 2000. What is the
code that would insert the actual text from the userform into the worksheet.
My text is in this form "May 03".
 

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

Top