Checkboxes

P

Powlaz

I have a workbook with 12 spreadsheets, each with 54
lines. One column in every spreadsheet will have a
checkbox in EVERY row.

1. Every time I enter a checkbox it is entered as
Checkbox 1548 or 941 etc. It's some random high
number. Shouldn't the first checkbox be named Checkbox
1?

2. Twice I have added a checkbox and copied it to every
other cell in the spreadsheet that requires it.
a. Is there a faster way to copy a checkbox 600x
rather than going from cell to cell?
b. I need each checkbox to be associated with the
cell next to it in the next column (B1 should be linked
to C1) Is there a fast way to link 600+ checkboxes to
the cells next to them?
c. I've experienced this strange phenomenon where I
close the workbook and reopen it and if I try to delete
one of the checkboxes (doesn't matter what row or on what
spreadsheet)there are 4 or 5 behind it. They seem to be
stacked one on top of the other so unless I lasso them
and delete the group I need to hit "Delete" 5 times. Why
are so many showing up? (This is happening in over 600
cells and really slows the workbook down).

Thanks for the help, this has been driving me crazy!!!

Matt
 
D

Dave Peterson

This adds checkboxes from the Forms toolbar to a worksheet:

Option Explicit
Sub addCBX()
Dim myCBX As CheckBox
Dim myCell As Range

With ActiveSheet
.CheckBoxes.Delete 'nice for testing
For Each myCell In ActiveSheet.Range("B1:B600").Cells
With myCell
Set myCBX = .Parent.CheckBoxes.Add _
(Top:=.Top, Width:=.Width, _
Left:=.Left, Height:=.Height)
With myCBX
.LinkedCell = myCell.Offset(0, 1).Address(external:=True)
.Caption = "" 'or whatever you want
.Name = "CBX_" & myCell.Address(0, 0)
End With
End With
Next myCell
End With
End Sub
 

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