Thread: checkboxes
View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
BrianB BrianB is offline
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/