ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Auto check list box (https://www.excelbanter.com/excel-programming/326553-auto-check-list-box.html)

Paul

Auto check list box
 
I have a listbox that automatically generates with a list of all the states.
It is set up for option button (fmListStyleOption) and multi-select enabled.
How can I select all of the states by default, given the user to option to
remove if necessary but not need to add if they want to go nationwide?

Thanks in advance.

--
Paul

Rowan[_2_]

Auto check list box
 
Paul

Add this to your initialize event after populating the listbox

Dim i As Integer
For i = 0 To ListBox1.ListCount - 1
ListBox1.Selected(i) = True
Next i

Regards
Rowan

"Paul" wrote:

I have a listbox that automatically generates with a list of all the states.
It is set up for option button (fmListStyleOption) and multi-select enabled.
How can I select all of the states by default, given the user to option to
remove if necessary but not need to add if they want to go nationwide?

Thanks in advance.

--
Paul



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

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