Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2
Default Enabling checkboxes in a listbox control

Ahh, I found the answer from another source.

For those who may have the same problem and are wondering,
it's found in the ".Selected" property.

Dim A As Boolean, Z(9) As String, I As Integer
With Userform1.Listbox1
For I = 0 To 9
.AddItem Z(I)
.Selected(I) = A
End If
Next I
End With

Ok, it was probably easy for the guru's but I'm dumb.
Tok

-----Original Message-----
I know to enable a checkbox for a listbox with a plain
liststyle would be something like:

Userform1.Listbox1.Text = "Listitem1"

How does one do this for an option liststyle? I'm

looking
to be able to multi-select several items in a listbox

with
the listbox liststyle set as an "option" list style with
multiselect property set as "multi".

Here's the code I have:

Dim A As Boolean
With Userform1.Listbox1
For I = 1 To 10
.AddItem Z(I)
If A Then
' Code here to checkbox if A is true.
End If
Next I
End With

Putting in the line "Userform1.Listbox1.Text = Z(I)" only
work for plain liststyles and only if you want one box
checked. It fails when the listbox is setup for
an "option" liststyle with multiselect as "multi".

Is it doable this way or am I just smoking something
really good?
Any advice appreciated!
Thanks,
Tok
.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I add a control check box to control other checkboxes? JGarland Excel Worksheet Functions 1 September 18th 08 12:26 PM
Hiding Control Toolbar Checkboxes Ellen G Excel Discussion (Misc queries) 2 September 24th 07 09:59 PM
format control on large number of checkboxes Daesthai Excel Worksheet Functions 0 June 6th 07 04:11 AM
Enabling a Embedded Control Kirk[_2_] Excel Programming 0 September 10th 03 06:10 PM
Enabling a Embedded Control Tim[_15_] Excel Programming 0 September 10th 03 05:29 PM


All times are GMT +1. The time now is 01:08 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"