Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
Is there a way to make a listview or something else that will contains 10 rows and 10 columns of checkbox only? So, the listview could contains 100 cases to click. Thank you! Alex -- Alex St-Pierre |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You can put them directly onto a worksheet.
"Alex St-Pierre" wrote: Hi, Is there a way to make a listview or something else that will contains 10 rows and 10 columns of checkbox only? So, the listview could contains 100 cases to click. Thank you! Alex -- Alex St-Pierre |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This adds to a form with a scrollable frame 100 checkboxes.
Create a UserForm, Frame (Frame1), CommandButton (CommandButton1) and stick the code behind the form: Private Sub CommandButton1_Click() Dim x As Integer, y As Integer Dim chk As MSForms.CheckBox, dblBuffer As Double Dim TopPos As Double, LeftPos As Double, OrigLeft As Double Frame1.ScrollBars = fmScrollBarsBoth ' Adjust the initial left and top to adjust ' the initial starting (top left) starting point OrigLeft = 5: TopPos = 5: LeftPos = OrigLeft ' Adjust the buffer to adjust the spacing between the controls dblBuffer = 2 For x = 1 To 10 For y = 1 To 10 Set chk = Me.AddCheckbox(TopPos:=TopPos, LeftPos:=LeftPos, Width:=15) LeftPos = LeftPos + chk.Width + dblBuffer Frame1.ScrollWidth = LeftPos + chk.Width Next TopPos = chk.Top + chk.Height + dblBuffer LeftPos = OrigLeft Frame1.ScrollHeight = chk.Top + chk.Height Next End Sub Function AddCheckbox(ByVal TopPos As Double, ByVal LeftPos As Double, ByVal Width As Double, _ Optional ByVal Height As Double = 18) As MSForms.CheckBox Dim Ctrl As MSForms.CheckBox Set Ctrl = Me.Frame1.Controls.Add("Forms.Checkbox.1", "") With Ctrl .Top = TopPos .Left = LeftPos .Width = Width .Height = Height End With Set AddCheckbox = Ctrl End Function -- Tim Zych SF, CA "Alex St-Pierre" wrote in message ... Hi, Is there a way to make a listview or something else that will contains 10 rows and 10 columns of checkbox only? So, the listview could contains 100 cases to click. Thank you! Alex -- Alex St-Pierre |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
It works well !! I'm wondering if there's a way to place each checkbox inside
a listview cases? Thanks! Alex -- Alex St-Pierre "Tim Zych" wrote: This adds to a form with a scrollable frame 100 checkboxes. Create a UserForm, Frame (Frame1), CommandButton (CommandButton1) and stick the code behind the form: Private Sub CommandButton1_Click() Dim x As Integer, y As Integer Dim chk As MSForms.CheckBox, dblBuffer As Double Dim TopPos As Double, LeftPos As Double, OrigLeft As Double Frame1.ScrollBars = fmScrollBarsBoth ' Adjust the initial left and top to adjust ' the initial starting (top left) starting point OrigLeft = 5: TopPos = 5: LeftPos = OrigLeft ' Adjust the buffer to adjust the spacing between the controls dblBuffer = 2 For x = 1 To 10 For y = 1 To 10 Set chk = Me.AddCheckbox(TopPos:=TopPos, LeftPos:=LeftPos, Width:=15) LeftPos = LeftPos + chk.Width + dblBuffer Frame1.ScrollWidth = LeftPos + chk.Width Next TopPos = chk.Top + chk.Height + dblBuffer LeftPos = OrigLeft Frame1.ScrollHeight = chk.Top + chk.Height Next End Sub Function AddCheckbox(ByVal TopPos As Double, ByVal LeftPos As Double, ByVal Width As Double, _ Optional ByVal Height As Double = 18) As MSForms.CheckBox Dim Ctrl As MSForms.CheckBox Set Ctrl = Me.Frame1.Controls.Add("Forms.Checkbox.1", "") With Ctrl .Top = TopPos .Left = LeftPos .Width = Width .Height = Height End With Set AddCheckbox = Ctrl End Function -- Tim Zych SF, CA "Alex St-Pierre" wrote in message ... Hi, Is there a way to make a listview or something else that will contains 10 rows and 10 columns of checkbox only? So, the listview could contains 100 cases to click. Thank you! Alex -- Alex St-Pierre |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Maybe, I shouldn't use the listview and align the text with the checkbox..!
-- Alex St-Pierre "Alex St-Pierre" wrote: It works well !! I'm wondering if there's a way to place each checkbox inside a listview cases? Thanks! Alex -- Alex St-Pierre "Tim Zych" wrote: This adds to a form with a scrollable frame 100 checkboxes. Create a UserForm, Frame (Frame1), CommandButton (CommandButton1) and stick the code behind the form: Private Sub CommandButton1_Click() Dim x As Integer, y As Integer Dim chk As MSForms.CheckBox, dblBuffer As Double Dim TopPos As Double, LeftPos As Double, OrigLeft As Double Frame1.ScrollBars = fmScrollBarsBoth ' Adjust the initial left and top to adjust ' the initial starting (top left) starting point OrigLeft = 5: TopPos = 5: LeftPos = OrigLeft ' Adjust the buffer to adjust the spacing between the controls dblBuffer = 2 For x = 1 To 10 For y = 1 To 10 Set chk = Me.AddCheckbox(TopPos:=TopPos, LeftPos:=LeftPos, Width:=15) LeftPos = LeftPos + chk.Width + dblBuffer Frame1.ScrollWidth = LeftPos + chk.Width Next TopPos = chk.Top + chk.Height + dblBuffer LeftPos = OrigLeft Frame1.ScrollHeight = chk.Top + chk.Height Next End Sub Function AddCheckbox(ByVal TopPos As Double, ByVal LeftPos As Double, ByVal Width As Double, _ Optional ByVal Height As Double = 18) As MSForms.CheckBox Dim Ctrl As MSForms.CheckBox Set Ctrl = Me.Frame1.Controls.Add("Forms.Checkbox.1", "") With Ctrl .Top = TopPos .Left = LeftPos .Width = Width .Height = Height End With Set AddCheckbox = Ctrl End Function -- Tim Zych SF, CA "Alex St-Pierre" wrote in message ... Hi, Is there a way to make a listview or something else that will contains 10 rows and 10 columns of checkbox only? So, the listview could contains 100 cases to click. Thank you! Alex -- Alex St-Pierre |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
link a checkbox in a sheet to a checkbox on a userform? | Excel Programming | |||
Userform Checkbox | Excel Programming | |||
can lookup a number to a 10x10 table? | Excel Worksheet Functions | |||
CheckBox in userform | Excel Programming | |||
CheckBox on UserForm | Excel Programming |