#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 208
Default Check Boxes

I am trying to insert a whole column of check boxes into an excell spread
sheet. I have figured out how to do one check box at a time. But if i try to
just copy and paste into the column it only copies it to the first selected
cell in the column.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Check Boxes

Saved from a previous post:

Here are two subroutines. The first one adds a bunch of checkboxes from the
Forms toolbar to a range in the activesheet (b3:B10).

The second one is the one that would do what you want to do when you
check/uncheck that box. It may not be necessary. If you don't need it, then
delete that procedure and comment out this line:

..OnAction = "'" & ThisWorkbook.Name & "'!dothework"

The first one only needs to be run once--to set up the checkboxes on the
worksheet.

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)
.OnAction = "'" & ThisWorkbook.Name & "'!dothework"
End With
.NumberFormat = ";;;"
End With

Next myCell
End With
End Sub

Sub DoTheWork()
Dim myCBX As CheckBox
Set myCBX = ActiveSheet.CheckBoxes(Application.Caller)

If myCBX = xlOn Then
'do something
Else
'do something else
End If

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

Craig wrote:

I am trying to insert a whole column of check boxes into an excell spread
sheet. I have figured out how to do one check box at a time. But if i try to
just copy and paste into the column it only copies it to the first selected
cell in the column.


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 194
Default Check Boxes

Craig

Place one checkbox in the top cell of the column you want to have filled
with the check boxes. Goto the lower right corner of the cell until you get
the small + and just drag down as far as you want the checkboxes.

Mike Rogers
Hope this Helps

"Craig" wrote:

I am trying to insert a whole column of check boxes into an excell spread
sheet. I have figured out how to do one check box at a time. But if i try to
just copy and paste into the column it only copies it to the first selected
cell in the column.

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
Linked Check Boxes blueegypt Excel Discussion (Misc queries) 4 May 12th 06 10:36 PM
Can one cell hold multiple check boxes (and then sort based off e. OT Excel Discussion (Misc queries) 1 March 29th 06 07:32 PM
why do check boxes move when printing excel spreadhseets Simon Jefford Excel Discussion (Misc queries) 3 June 22nd 05 02:04 PM
Selecting Check Boxes shezzer_1972 Excel Discussion (Misc queries) 7 May 11th 05 01:10 AM
How to align check boxes on an Excel sheet? CC Excel Worksheet Functions 2 February 16th 05 03:27 PM


All times are GMT +1. The time now is 03:18 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"