Thread: CheckBox
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Leith Ross[_542_] Leith Ross[_542_] is offline
external usenet poster
 
Posts: 1
Default CheckBox


Hello Herd,

Yes it can be done and placed into a loop...
______________________________

Sub AddCheckBoxes()

'Add A Forms CheckBox

Dim Cell As Range
Dim Col As String
Dim LinkCol
Dim R As Long
Dim Value

Col = "B"
Value = "Mark"
LinkCol = "D"

For R = 1 To ActiveSheet.Cells(Rows.Count, Col).Row
Set Cell = ActiveSheet.Cells(R, Col)
If Cell.Value = Value Then
With ActiveSheet.Shapes
..AddFormControl xlCheckBox, Cell.Left, Cell.Top, Cell.Width,
Cell.Height
End With

Shapes(Shapes.Count).ControlFormat.LinkedCell = Cell.(R,
LinkCol).Address
End If
Next R

End Sub
______________________________

Sincerely,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=509609