Hi All,
I have checkbox inside listbox 1. I need to click checkbox and click OK button to filter those that I need.
Anyone able to help. I going mad with this.
Below are code:
Private Sub ALL_Click()
Dim r As Integer
For r = 0 To ListBox1.ListCount - 1
ListBox1.Selected(r) = True
Next r
End Sub
Private Sub Non_Click()
Dim r As Integer
For r = 0 To ListBox1.ListCount - 1
ListBox1.Selected(r) = False
Next r
End Sub
Private Sub userform_initialize()
Dim colcnt As Integer
Dim rng As Range
Dim c As Integer
colcnt = ActiveSheet.UsedRange.Columns.Count
Set rng = ActiveSheet.UsedRange
With ListBox1
.ColumnCount = colcnt
.RowSource = rng.Address
cw = ""
For c = 1 To .ColumnCount
cw = cw & rng.Columns(c).Width & ";"
Next c
.ColumnWidths = cw
.ListIndex = 0
End With
End Sub
-- removed inline image ---
I have checkbox inside listbox 1. I need to click checkbox and click OK button to filter those that I need.
Anyone able to help. I going mad with this.
Below are code:
Private Sub ALL_Click()
Dim r As Integer
For r = 0 To ListBox1.ListCount - 1
ListBox1.Selected(r) = True
Next r
End Sub
Private Sub Non_Click()
Dim r As Integer
For r = 0 To ListBox1.ListCount - 1
ListBox1.Selected(r) = False
Next r
End Sub
Private Sub userform_initialize()
Dim colcnt As Integer
Dim rng As Range
Dim c As Integer
colcnt = ActiveSheet.UsedRange.Columns.Count
Set rng = ActiveSheet.UsedRange
With ListBox1
.ColumnCount = colcnt
.RowSource = rng.Address
cw = ""
For c = 1 To .ColumnCount
cw = cw & rng.Columns(c).Width & ";"
Next c
.ColumnWidths = cw
.ListIndex = 0
End With
End Sub
-- removed inline image ---