A check box in a list box

anthonyenglish

New Member
Joined
Jan 17, 2005
Messages
19
I have a list box with 4 columns. I would like to have one of the columns to contain a check box as the value it relates to is either true or false. Can a list box contain a check box and if so, how. Any answers before I pull anymore hair out?

My code is below

Private Sub UserForm_Initialize()
Dim intCounter As Integer
Dim intLastRow As Integer

intLastRow = Cells(1, 1).End(xlDown).Row

For intCounter = 4 To intLastRow
frmDates.lstData.ColumnCount = 4
frmDates.lstData.AddItem Cells(intCounter, 2).Value
frmDates.lstData.List(intCounter - 4, 1) = Cells(intCounter, 1).Value
frmDates.lstData.List(intCounter - 4, 2) = Cells(intCounter, 2).Value
frmDates.lstData.List(intCounter - 4, 3) = Cells(intCounter, 20).Value
frmDates.lstData.TextColumn = 4



Next intCounter
frmDates.Show

End Sub
 

Excel Facts

Difference between two dates
Secret function! Use =DATEDIF(A2,B2,"Y")&" years"&=DATEDIF(A2,B2,"YM")&" months"&=DATEDIF(A2,B2,"MD")&" days"

parry

MrExcel MVP
Joined
Aug 20, 2002
Messages
3,355
Hi Anthony, welcome to the board. You can have a checkbox or option button within a listbox, but only to enable selection of items from the list. The checkboxes would usually be for multi-selection of list items.

I dont believe you can change a listbox to display anything other than a list of items (ie not a checkbox on/off value as a list item).
 

Forum statistics

Threads
1,148,216
Messages
5,745,436
Members
423,951
Latest member
peggrif

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top