Multiple checkboxes and aligning

G

Guest

I'm building a spreadsheet where I'll need about a 100 or so checkboxes. I'm
wondering if there is an esieir way of "linking" them with the correct cell
(Most of the time they will be adjacent or the same ratio and, 2nd) if
there's an easier way of aligning (fitting) them into a cell. It seems each
"box" has to be "fitted", kind of "one at a time". I know I can copy a group
but they still need quite a bit of minor adjustments.
I hope I've explianed this coherently...enough.
 
D

Dave Peterson

One way is to use a macro.

This macro adds checkboxes from the Forms toolbar into a specific range:

Option Explicit
Sub testme()

Dim myCBX As CheckBox
Dim myCell As Range

With ActiveSheet
.CheckBoxes.Delete
For Each myCell In ActiveSheet.Range("B3:B10").Cells
With myCell
Set myCBX = .Parent.CheckBoxes.Add _
(Top:=.Top, Width:=.Width, _
Left:=.Left, Height:=.Height)
With myCBX
.LinkedCell = myCell.Address(external:=True)
.Caption = ""
.Name = "CBX_" & myCell.Address(0, 0)
End With
.NumberFormat = ";;;"
End With

Next myCell
End With
End Sub

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm
 
G

Guest

I hope I've understood.

Select all the checkboxes by holding Ctrl and clicking each one.

On the drawing toolbar click

Draw|align or distribute|align left or however you want them aligning.

Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top