ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Reading List Box Value (https://www.excelbanter.com/excel-programming/277937-re-reading-list-box-value.html)

Dave Peterson[_3_]

Reading List Box Value
 
Is is a simple listbox from the control toolbox toolbar?

maybe:
Option Explicit
Private Sub ListBox1_Click()
MsgBox Me.ListBox1.Value
End Sub

If you have a linked cell, you could just look there, too.

Bob Wilcox wrote:

Hello,

In one module, I have sucessfully created and populated a
listbox on a worksheet. My last LOC in that module is to
Set objListBox = Nothing.

However, in the module, "ListBox_Click" (which does
display a MsgBox when clicked), I cannot determine the
values of the clicked data. Question, do I use Shapes,
Controls or somthing else? What and how do I set the
object?

B Wilcox


--

Dave Peterson


B Wilcox

Reading List Box Value
 
I used the command:

Set objListBox = .Shapes.AddFormControl(xlListBox, 400,
10, 100, 400)

to create theb list box.



-----Original Message-----
Is is a simple listbox from the control toolbox toolbar?

maybe:
Option Explicit
Private Sub ListBox1_Click()
MsgBox Me.ListBox1.Value
End Sub

If you have a linked cell, you could just look there, too.

Bob Wilcox wrote:

Hello,

In one module, I have sucessfully created and populated

a
listbox on a worksheet. My last LOC in that module is

to
Set objListBox = Nothing.

However, in the module, "ListBox_Click" (which does
display a MsgBox when clicked), I cannot determine the
values of the clicked data. Question, do I use Shapes,
Controls or somthing else? What and how do I set the
object?

B Wilcox


--

Dave Peterson

.



All times are GMT +1. The time now is 12:25 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com