Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 169
Default Userform - 100 checkbox (10X10)

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,986
Default Userform - 100 checkbox (10X10)

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 389
Default Userform - 100 checkbox (10X10)

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 169
Default Userform - 100 checkbox (10X10)

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 169
Default Userform - 100 checkbox (10X10)

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
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
link a checkbox in a sheet to a checkbox on a userform? Arjan Excel Programming 0 November 10th 06 01:37 PM
Userform Checkbox Bill[_30_] Excel Programming 1 June 20th 06 10:07 PM
can lookup a number to a 10x10 table? olasa Excel Worksheet Functions 0 June 1st 05 02:42 PM
CheckBox in userform MD Excel Programming 2 December 2nd 04 06:42 PM
CheckBox on UserForm Michel[_4_] Excel Programming 0 August 3rd 04 12:38 AM


All times are GMT +1. The time now is 10:02 AM.

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

About Us

"It's about Microsoft Excel"