Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am working with a sheet that contains on average 100 items. Next to
each record I would like to place a checkbox. Therefore, how do I: 1. Assign that checkbox to that particular row (as it looks like the checkbox is floating on the sheet and not assigned to a cell), so that when that checkbox is selected it identifies that the information in that active row needs to be selected 2. When the checkbox is unchecked for the row to be returned to its original state (i.e. is there a statement such as checkbox = false then ... ) any help greatly appreciated as my knowledge of using checkboxes is very limited. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Multiple checkboxes and aligning | Excel Discussion (Misc queries) | |||
Multiple Checkboxes | Excel Discussion (Misc queries) | |||
Multiple Checkboxes Shortcut? | Excel Discussion (Misc queries) | |||
Multiple checkboxes, one macro? | Excel Programming | |||
Multiple checkboxes 1 macro | Excel Programming |