Thread: check boxes
View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default check boxes

If you used a checkbox from the Control toolbox toolbar instead of a checkbox
from the Forms toolbar, you could change a property to move and size with cells.

You could record a macro to get the syntax.

ranswert wrote:

I have the following code that adds a checkbox to my worksheet:

Sub addcheckbox()
Dim a As String
Dim costid As String
Dim cboxname As Integer
Dim cell As Range
Dim chk As Excel.CheckBox
Set cell = ActiveCell
Set chk = cell.Parent.CheckBoxes.Add(cell.Left, cell.Top, 12, cell.Height)
costid = id
MsgBox ("costid =" & costid)
chk.Height = cell.Height - 1.5
cboxname = ActiveCell.EntireRow.Cells(13)
chk.Characters.Text = none
chk.name = "Checkbox" & costid & cboxname
chk.LinkedCell = ActiveCell.EntireRow.Cells(14).Address
ActiveCell.Select

End Sub

When I go to hide the range that contains the check box, the check box isn't
hidden. Is the a property that I need to set to hide the check box?
Thanks


--

Dave Peterson