IREALLYambatman
Board Regular
- Joined
- Aug 31, 2016
- Messages
- 63
Hey guys. So I've managed to modify some coding I found here to insert checkboxes into a file I'm working on. I am trying to make it into a Macro that I would call from another macro that that would place checkboxes in the center of the Range I would give it.. ie. Call CB("A1:B5") And that would place checkboxes in that whole range. I'd appreciate any help
Code:
Sub CB()
Dim cell, LRow As Single
Dim chkbx As CheckBox
Dim CLeft, CTop, CHeight, CWidth As Double
For cell = 6 To 27
CLeft = Cells(cell, "E").Left
CTop = Cells(cell, "E").Top
CHeight = Cells(cell, "E").Height
CWidth = Cells(cell, "E").Width
ActiveSheet.CheckBoxes.Add(CLeft + (CWidth / 2), CTop, CWidth, CHeight).Select
With Selection
.Caption = ""
.value = xlOn
.Display3DShading = False
End With
Next cell