#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default checkboxes

Hi, I was wondering if you guys could help me with something. I have t
create a column with several checkboxes, all linked to a respectiv
cell. My idea is something like this:

count=1
cell=1

Do

create checkbox in 'A'cell
link checkbox to 'A'cell

count= count +1
cell = cell +1

while count < 1000

Can anyone help me with the syntax?

Thanks a lot

Mar

--
Message posted from http://www.ExcelForum.com

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default checkboxes

Sub Macro1()
' clear existing checkboxes
ActiveSheet.CheckBoxes.Delete
For Each cell In Range("A1:A1000")
With ActiveSheet.CheckBoxes.Add( _
cell.Left, cell.Top, cell.Width, cell.Height)
.LinkedCell = cell.Address(external:=True)
.Caption = ""
End With
Next
End Sub


Uses checkboxes from the forms toolbar.

--
Regards,
Tom Ogilvy

"marksuza" wrote in message
...
Hi, I was wondering if you guys could help me with something. I have to
create a column with several checkboxes, all linked to a respective
cell. My idea is something like this:

count=1
cell=1

Do

create checkbox in 'A'cell
link checkbox to 'A'cell

count= count +1
cell = cell +1

while count < 1000

Can anyone help me with the syntax?

Thanks a lot

Mark


---
Message posted from http://www.ExcelForum.com/



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default checkboxes

This uses the Checkbox from the Forms toolbar. I don't recommend the one
on the Controls toolbar because it tends to be very buggy - especially
when using large numbers. Amend as necessary.

'---------------------------------------------
Sub MAKE_CHECKBOXES()
Dim CB As Integer
Dim CBox As Object
Dim CBcount As Long
Dim CBtop As Double
Dim CBlink As String
'------------------------------------------
CBcount = ActiveSheet.CheckBoxes.Count
For CB = CBcount + 1 To 10
CBtop = CB * 25
CBlink = "A" & CB
ActiveSheet.CheckBoxes.Add 50, CBtop, 60, 20
Set CBox = ActiveSheet.CheckBoxes(CB)
With CBox
Text = "MyBox" & CB
Value = xlOff
LinkedCell = CBlink
Interior.ColorIndex = 40
Border.LineStyle = msoLineSingle
Border.Weight = xlMedium
Display3DShading = True
End With
Next
End Sub
'--------------------------------------------


---
Message posted from http://www.ExcelForum.com/

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default checkboxes

Thanks for the help, really helpful.

Mark


---
Message posted from http://www.ExcelForum.com/

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
Checkboxes Elaine Excel Discussion (Misc queries) 6 August 20th 09 01:41 AM
Using Checkboxes ppidgursky Excel Discussion (Misc queries) 0 April 7th 09 07:24 PM
Checkboxes stretch Excel Worksheet Functions 4 September 14th 07 12:36 PM
checkboxes helpless101 Excel Worksheet Functions 0 April 10th 06 11:54 AM
Checkboxes Randy L Excel Discussion (Misc queries) 3 February 22nd 06 08:09 PM


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

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"