How to prevent list item selection
Thanks for catching that Dave (I had meant to post it the first way you
showed).
--
Rick (MVP - Excel)
"Dave Peterson" wrote in message
...
I think you meant:
WorkSheets("Sheet1").Shapes("List Box 2"). _
OLEFormat.Object.ListIndex = 0
or
ActiveSheet.Shapes("List Box 2"). _
OLEFormat.Object.ListIndex = 0
=====
But another way is to go through the Listboxes collection:
Worksheets("Sheet1").ListBoxes("List box 2").ListIndex = 0
Rick Rothstein wrote:
You forgot to tell us where you got the ListBox from... the Control
ToolBox
toolbar or the Forms toolbar. Try one of these (whichever is relevant to
your setup)...
Control ToolBox Toolbar
==========================
ToolBox: WorkSheets("Sheet1").ListBox1.ListIndex = -1
Forms Toolbar
==========================
WorkSheets("Sheet1").ActiveSheet.Shapes("List Box 2"). _
OLEFormat.Object.ListIndex = 0
Change the name of the worksheet and the name of the ListBox to match the
actual names used in your setup.
--
Rick (MVP - Excel)
"Robert Flanagan" wrote in message
...
I'm having one of those blond moments (no offense to any blonds). I
have
a simple list box to display information. I want to immediately
unselect
any item that is selected. None of the obvious items I've tried
worked.
Any suggestions?
--
Dave Peterson
|