Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Adding multiple checkboxes

I am creating a large data entry excel spreadsheet and I want to be able to
insert, probably 100+ check boxes, my problem is that I dont want to have to
associate every single checkbox with every single cell. is there a way that I
can just click and drag (like fomulas do) and have the cells be populated by
checkboxes.

I do not want to have to right click each checkbox -- properties --
control, and then link the value to a cell.

Please help!
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Adding multiple checkboxes

Here's a macro by Dave Peterson:

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("a2:a10").Cells
With myCell
Set myCBX = .Parent.CheckBoxes.Add _
(Top:=.Top, Width:=.Width, _
Left:=.Left, Height:=.Height)
With myCBX
.LinkedCell = myCell.Address(external:=True)
'.Caption = "" 'or whatever you want
'.Name = "CBX_" & myCell.Address(0, 0)
End With
.NumberFormat = ";;;"
End With
Next myCell
End With
End Sub

Change the range (set to A2:A10) as needed. The macro automatically sets the
linked cell to be the same cell the checkbox is "in". It also sets the
linked cell font format to be "invisible". If you want custom captions for
each checkbox you have to do that manually. If you want no caption "un REM"
the line:

'.Caption = "" 'or whatever you want

To:

..Caption = "" 'or whatever you want

Note: make sure the column is wide enough (about ~130 pixels) otherwise the
default caption could get truncated.

Biff

"timmeah4" wrote in message
...
I am creating a large data entry excel spreadsheet and I want to be able to
insert, probably 100+ check boxes, my problem is that I dont want to have
to
associate every single checkbox with every single cell. is there a way
that I
can just click and drag (like fomulas do) and have the cells be populated
by
checkboxes.

I do not want to have to right click each checkbox -- properties --
control, and then link the value to a cell.

Please help!



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Adding multiple checkboxes

Thank you so much, this macro is awesome!

"T. Valko" wrote:

Here's a macro by Dave Peterson:

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("a2:a10").Cells
With myCell
Set myCBX = .Parent.CheckBoxes.Add _
(Top:=.Top, Width:=.Width, _
Left:=.Left, Height:=.Height)
With myCBX
.LinkedCell = myCell.Address(external:=True)
'.Caption = "" 'or whatever you want
'.Name = "CBX_" & myCell.Address(0, 0)
End With
.NumberFormat = ";;;"
End With
Next myCell
End With
End Sub

Change the range (set to A2:A10) as needed. The macro automatically sets the
linked cell to be the same cell the checkbox is "in". It also sets the
linked cell font format to be "invisible". If you want custom captions for
each checkbox you have to do that manually. If you want no caption "un REM"
the line:

'.Caption = "" 'or whatever you want

To:

..Caption = "" 'or whatever you want

Note: make sure the column is wide enough (about ~130 pixels) otherwise the
default caption could get truncated.

Biff

"timmeah4" wrote in message
...
I am creating a large data entry excel spreadsheet and I want to be able to
insert, probably 100+ check boxes, my problem is that I dont want to have
to
associate every single checkbox with every single cell. is there a way
that I
can just click and drag (like fomulas do) and have the cells be populated
by
checkboxes.

I do not want to have to right click each checkbox -- properties --
control, and then link the value to a cell.

Please help!




  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Adding multiple checkboxes

I'll take the credit for realizing how useful it is and saving it and give
Dave due credit for writing it. Dave's the man!

Biff

"timmeah4" wrote in message
...
Thank you so much, this macro is awesome!

"T. Valko" wrote:

Here's a macro by Dave Peterson:

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("a2:a10").Cells
With myCell
Set myCBX = .Parent.CheckBoxes.Add _
(Top:=.Top, Width:=.Width, _
Left:=.Left, Height:=.Height)
With myCBX
.LinkedCell = myCell.Address(external:=True)
'.Caption = "" 'or whatever you want
'.Name = "CBX_" & myCell.Address(0, 0)
End With
.NumberFormat = ";;;"
End With
Next myCell
End With
End Sub

Change the range (set to A2:A10) as needed. The macro automatically sets
the
linked cell to be the same cell the checkbox is "in". It also sets the
linked cell font format to be "invisible". If you want custom captions
for
each checkbox you have to do that manually. If you want no caption "un
REM"
the line:

'.Caption = "" 'or whatever you want

To:

..Caption = "" 'or whatever you want

Note: make sure the column is wide enough (about ~130 pixels) otherwise
the
default caption could get truncated.

Biff

"timmeah4" wrote in message
...
I am creating a large data entry excel spreadsheet and I want to be able
to
insert, probably 100+ check boxes, my problem is that I dont want to
have
to
associate every single checkbox with every single cell. is there a way
that I
can just click and drag (like fomulas do) and have the cells be
populated
by
checkboxes.

I do not want to have to right click each checkbox -- properties --
control, and then link the value to a cell.

Please help!






  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Adding multiple checkboxes

It may be pretty, but I like to just put X's in cells <bg.

"T. Valko" wrote:

I'll take the credit for realizing how useful it is and saving it and give
Dave due credit for writing it. Dave's the man!

Biff

"timmeah4" wrote in message
...
Thank you so much, this macro is awesome!

"T. Valko" wrote:

Here's a macro by Dave Peterson:

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("a2:a10").Cells
With myCell
Set myCBX = .Parent.CheckBoxes.Add _
(Top:=.Top, Width:=.Width, _
Left:=.Left, Height:=.Height)
With myCBX
.LinkedCell = myCell.Address(external:=True)
'.Caption = "" 'or whatever you want
'.Name = "CBX_" & myCell.Address(0, 0)
End With
.NumberFormat = ";;;"
End With
Next myCell
End With
End Sub

Change the range (set to A2:A10) as needed. The macro automatically sets
the
linked cell to be the same cell the checkbox is "in". It also sets the
linked cell font format to be "invisible". If you want custom captions
for
each checkbox you have to do that manually. If you want no caption "un
REM"
the line:

'.Caption = "" 'or whatever you want

To:

..Caption = "" 'or whatever you want

Note: make sure the column is wide enough (about ~130 pixels) otherwise
the
default caption could get truncated.

Biff

"timmeah4" wrote in message
...
I am creating a large data entry excel spreadsheet and I want to be able
to
insert, probably 100+ check boxes, my problem is that I dont want to
have
to
associate every single checkbox with every single cell. is there a way
that I
can just click and drag (like fomulas do) and have the cells be
populated
by
checkboxes.

I do not want to have to right click each checkbox -- properties --
control, and then link the value to a cell.

Please help!




--

Dave Peterson


  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 4
Default Adding multiple checkboxes

Hi guys, I dont know if youll reply now that this has gotten to the 4th page.
But im noticing the check boxes start to creep up in their postition the more
I add, i want to add 30 of these checkboxes to a particular column, and the
30th is on the 29th row, it makes it hard for the user to know exactly what
they are clicking. Is there a way to clean this formatting up?

As in I have 30checkboxes in 29 rows, rather than a check box in each row

"Dave Peterson" wrote:

It may be pretty, but I like to just put X's in cells <bg.

"T. Valko" wrote:

I'll take the credit for realizing how useful it is and saving it and give
Dave due credit for writing it. Dave's the man!

Biff

"timmeah4" wrote in message
...
Thank you so much, this macro is awesome!

"T. Valko" wrote:

Here's a macro by Dave Peterson:

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("a2:a10").Cells
With myCell
Set myCBX = .Parent.CheckBoxes.Add _
(Top:=.Top, Width:=.Width, _
Left:=.Left, Height:=.Height)
With myCBX
.LinkedCell = myCell.Address(external:=True)
'.Caption = "" 'or whatever you want
'.Name = "CBX_" & myCell.Address(0, 0)
End With
.NumberFormat = ";;;"
End With
Next myCell
End With
End Sub

Change the range (set to A2:A10) as needed. The macro automatically sets
the
linked cell to be the same cell the checkbox is "in". It also sets the
linked cell font format to be "invisible". If you want custom captions
for
each checkbox you have to do that manually. If you want no caption "un
REM"
the line:

'.Caption = "" 'or whatever you want

To:

..Caption = "" 'or whatever you want

Note: make sure the column is wide enough (about ~130 pixels) otherwise
the
default caption could get truncated.

Biff

"timmeah4" wrote in message
...
I am creating a large data entry excel spreadsheet and I want to be able
to
insert, probably 100+ check boxes, my problem is that I dont want to
have
to
associate every single checkbox with every single cell. is there a way
that I
can just click and drag (like fomulas do) and have the cells be
populated
by
checkboxes.

I do not want to have to right click each checkbox -- properties --
control, and then link the value to a cell.

Please help!




--

Dave Peterson

  #7   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 15,768
Default Adding multiple checkboxes

Hmmm.....

I've not experienced that. I tried it in various range sizes up to 200 rows
and each ckbx is positioned exactly the same in each row. I'm using the
default row height 12.75. Are all your rows the same height? Other than that
I have no other thoughts.

Biff

"timmeah4" wrote in message
...
Hi guys, I dont know if youll reply now that this has gotten to the 4th
page.
But im noticing the check boxes start to creep up in their postition the
more
I add, i want to add 30 of these checkboxes to a particular column, and
the
30th is on the 29th row, it makes it hard for the user to know exactly
what
they are clicking. Is there a way to clean this formatting up?

As in I have 30checkboxes in 29 rows, rather than a check box in each row

"Dave Peterson" wrote:

It may be pretty, but I like to just put X's in cells <bg.

"T. Valko" wrote:

I'll take the credit for realizing how useful it is and saving it and
give
Dave due credit for writing it. Dave's the man!

Biff

"timmeah4" wrote in message
...
Thank you so much, this macro is awesome!

"T. Valko" wrote:

Here's a macro by Dave Peterson:

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("a2:a10").Cells
With myCell
Set myCBX = .Parent.CheckBoxes.Add _
(Top:=.Top, Width:=.Width, _
Left:=.Left, Height:=.Height)
With myCBX
.LinkedCell = myCell.Address(external:=True)
'.Caption = "" 'or whatever you want
'.Name = "CBX_" & myCell.Address(0, 0)
End With
.NumberFormat = ";;;"
End With
Next myCell
End With
End Sub

Change the range (set to A2:A10) as needed. The macro automatically
sets
the
linked cell to be the same cell the checkbox is "in". It also sets
the
linked cell font format to be "invisible". If you want custom
captions
for
each checkbox you have to do that manually. If you want no caption
"un
REM"
the line:

'.Caption = "" 'or whatever you want

To:

..Caption = "" 'or whatever you want

Note: make sure the column is wide enough (about ~130 pixels)
otherwise
the
default caption could get truncated.

Biff

"timmeah4" wrote in message
...
I am creating a large data entry excel spreadsheet and I want to be
able
to
insert, probably 100+ check boxes, my problem is that I dont want
to
have
to
associate every single checkbox with every single cell. is there a
way
that I
can just click and drag (like fomulas do) and have the cells be
populated
by
checkboxes.

I do not want to have to right click each checkbox --
properties --
control, and then link the value to a cell.

Please help!




--

Dave Peterson



  #8   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Adding multiple checkboxes

Just to add to Biff's thoughts. I seem to have better luck when the zoom is set
to 100%. What is your zoom set to?

timmeah4 wrote:

Hi guys, I dont know if youll reply now that this has gotten to the 4th page.
But im noticing the check boxes start to creep up in their postition the more
I add, i want to add 30 of these checkboxes to a particular column, and the
30th is on the 29th row, it makes it hard for the user to know exactly what
they are clicking. Is there a way to clean this formatting up?

As in I have 30checkboxes in 29 rows, rather than a check box in each row

"Dave Peterson" wrote:

It may be pretty, but I like to just put X's in cells <bg.

"T. Valko" wrote:

I'll take the credit for realizing how useful it is and saving it and give
Dave due credit for writing it. Dave's the man!

Biff

"timmeah4" wrote in message
...
Thank you so much, this macro is awesome!

"T. Valko" wrote:

Here's a macro by Dave Peterson:

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("a2:a10").Cells
With myCell
Set myCBX = .Parent.CheckBoxes.Add _
(Top:=.Top, Width:=.Width, _
Left:=.Left, Height:=.Height)
With myCBX
.LinkedCell = myCell.Address(external:=True)
'.Caption = "" 'or whatever you want
'.Name = "CBX_" & myCell.Address(0, 0)
End With
.NumberFormat = ";;;"
End With
Next myCell
End With
End Sub

Change the range (set to A2:A10) as needed. The macro automatically sets
the
linked cell to be the same cell the checkbox is "in". It also sets the
linked cell font format to be "invisible". If you want custom captions
for
each checkbox you have to do that manually. If you want no caption "un
REM"
the line:

'.Caption = "" 'or whatever you want

To:

..Caption = "" 'or whatever you want

Note: make sure the column is wide enough (about ~130 pixels) otherwise
the
default caption could get truncated.

Biff

"timmeah4" wrote in message
...
I am creating a large data entry excel spreadsheet and I want to be able
to
insert, probably 100+ check boxes, my problem is that I dont want to
have
to
associate every single checkbox with every single cell. is there a way
that I
can just click and drag (like fomulas do) and have the cells be
populated
by
checkboxes.

I do not want to have to right click each checkbox -- properties --
control, and then link the value to a cell.

Please help!




--

Dave Peterson


--

Dave Peterson
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
Adding multiple worksheets tee Excel Worksheet Functions 2 August 19th 06 12:35 AM
Adding same cells across multiple worksheets LACA Excel Worksheet Functions 2 January 19th 06 03:21 PM
adding duplicate text to multiple cells beardic Excel Discussion (Misc queries) 4 May 18th 05 09:44 PM
Adding Data Using Multiple Worksheets to Total into a Grand Total Lillie Excel Worksheet Functions 1 April 19th 05 08:34 PM
Need Function for adding rows on multiple sheets... struggling rookie ;) Thanks. Steve Excel Worksheet Functions 6 November 24th 04 12:10 AM


All times are GMT +1. The time now is 11:47 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"