Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Selecting many Checkboxes to align & size


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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Selecting many Checkboxes to align & size

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7,247
Default Selecting many Checkboxes to align & size

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Selecting many Checkboxes to align & size


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
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
Align Diana Excel Discussion (Misc queries) 2 May 12th 10 04:51 AM
Align dollar symbol, align currency symbol... Mark Excel Discussion (Misc queries) 1 April 9th 08 03:39 AM
Selecting area of unfixed size, creating borders paulold Excel Programming 2 April 12th 06 09:21 AM
Left align '$' and right align numbers? skeetley Excel Discussion (Misc queries) 1 October 21st 05 08:12 AM
What is short-Cut forleft align and Right align? Sandy Excel Discussion (Misc queries) 1 February 24th 05 12:25 PM


All times are GMT +1. The time now is 12:39 PM.

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"