Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() Hi Now my programs for my check boxes are working nicely thanks to Tom. I looks a little messy. How can I align and size all of my check boxes t be exactly the same. I thought it would be obvious, to be fair it still could be! :rolleyes -- Sa ----------------------------------------------------------------------- Saz's Profile: http://www.excelforum.com/member.php...fo&userid=1722 View this thread: http://www.excelforum.com/showthread.php?threadid=54952 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I'm assuming you used checkboxes from the Controls toolbar. Set
the left, height and width properties of the first check box to the values you desire, then run the following code: Sub AAA() Dim FirstCheckbox As msforms.CheckBox Dim Chk As OLEObject For Each Chk In ActiveSheet.OLEObjects If TypeOf Chk.Object Is msforms.CheckBox Then If FirstCheckbox Is Nothing Then Set FirstCheckbox = Chk.Object Else Chk.Left = FirstCheckbox.Left Chk.Height = FirstCheckbox.Height Chk.Width = FirstCheckbox.Width End If End If Next Chk End Sub -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Saz" wrote in message ... Hi Now my programs for my check boxes are working nicely thanks to Tom. It looks a little messy. How can I align and size all of my check boxes to be exactly the same. I thought it would be obvious, to be fair it still could be! ![]() -- Saz ------------------------------------------------------------------------ Saz's Profile: http://www.excelforum.com/member.php...o&userid=17226 View this thread: http://www.excelforum.com/showthread...hreadid=549528 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
A better solution is as follows:
Sub AAA() Dim ReferenceCheckbox As msforms.CheckBox Dim Chk As OLEObject Set ReferenceCheckbox = ActiveSheet.OLEObjects("checkbox1").Object For Each Chk In ActiveSheet.OLEObjects If TypeOf Chk.Object Is msforms.CheckBox Then Chk.Left = ReferenceCheckbox.Left Chk.Height = ReferenceCheckbox.Height Chk.Width = ReferenceCheckbox.Width End If Next Chk End Sub Change "checkbox1" to the checkbox whose properties you want to use for left, height, and width. -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Chip Pearson" wrote in message ... I'm assuming you used checkboxes from the Controls toolbar. Set the left, height and width properties of the first check box to the values you desire, then run the following code: Sub AAA() Dim FirstCheckbox As msforms.CheckBox Dim Chk As OLEObject For Each Chk In ActiveSheet.OLEObjects If TypeOf Chk.Object Is msforms.CheckBox Then If FirstCheckbox Is Nothing Then Set FirstCheckbox = Chk.Object Else Chk.Left = FirstCheckbox.Left Chk.Height = FirstCheckbox.Height Chk.Width = FirstCheckbox.Width End If End If Next Chk End Sub -- Cordially, Chip Pearson Microsoft MVP - Excel Pearson Software Consulting, LLC www.cpearson.com "Saz" wrote in message ... Hi Now my programs for my check boxes are working nicely thanks to Tom. It looks a little messy. How can I align and size all of my check boxes to be exactly the same. I thought it would be obvious, to be fair it still could be! ![]() -- Saz ------------------------------------------------------------------------ Saz's Profile: http://www.excelforum.com/member.php...o&userid=17226 View this thread: http://www.excelforum.com/showthread...hreadid=549528 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() That has sorted it thanks Chip -- Sa ----------------------------------------------------------------------- Saz's Profile: http://www.excelforum.com/member.php...fo&userid=1722 View this thread: http://www.excelforum.com/showthread.php?threadid=54952 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Align | Excel Discussion (Misc queries) | |||
Align dollar symbol, align currency symbol... | Excel Discussion (Misc queries) | |||
Selecting area of unfixed size, creating borders | Excel Programming | |||
Left align '$' and right align numbers? | Excel Discussion (Misc queries) | |||
What is short-Cut forleft align and Right align? | Excel Discussion (Misc queries) |