View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] martin.a.john@gmail.com is offline
external usenet poster
 
Posts: 11
Default Multiple checkboxes

On 12 May, 21:11, merjet wrote:
Here is a macro that puts CheckBoxes in cells A1:A10 of Sheet1 and
makes B1:B10 the LinkedCells. Modify to suit.

Hth,
Merjet

Sub Macro1()
Dim ws As Worksheet
Set ws = Sheets("Sheet1")
Set rng = ws.Range("A1:A10")
For Each c In rng
With ws.OLEObjects.Add( _
ClassType:="Forms.CheckBox.1", _
Link:=False, _
DisplayAsIcon:=False, _
Left:=c.Left, _
Top:=c.Top, _
Width:=c.Width, _
Height:=c.Height)
.Object.Caption = ""
.LinkedCell = c.Offset(0, 1).Address
.Object.Value = False
End With
Next c
End Sub


This is cool, thanks so much.
It solved a lot of problems and my time from manually creating check
boxes.

good work!