Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro for checkbox generation
Hi all, I'm not the most experienced of Excel users so please bear with me. I' looking to generate a macro (because I'm lazy) that will place about 50 checkboxes in a single column, row by row. It also needs to move an resize according to the data in an adjacent cell (i.e. if the text nex to it is too large and wordwraps another line, the box must move wit it). One checkbox per row is what I'm getting at. This is the code I'm currently using: Dim myCBX As CheckBox Dim myCell As Range With ActiveSheet .CheckBoxes.Delete 'nice for setting up For Each myCell In ActiveSheet.Range("O13:O503").Cells With myCell Set myCBX = .Parent.CheckBoxes.Add _ (Top:=.Top, Width:=.Width, _ Left:=.Left, Height:=.Height) With myCBX .LinkedCell = myCell.Address(external:=True) .Caption = "" .Name = "CBX_" & myCell.Address(0, 0) End With .NumberFormat = ";;;" End With Next myCell End With End Sub Please and thanks -- rmcveig ----------------------------------------------------------------------- rmcveigh's Profile: http://www.excelforum.com/member.php...fo&userid=3735 View this thread: http://www.excelforum.com/showthread.php?threadid=57145 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
checkbox = macro? | Excel Discussion (Misc queries) | |||
Checkbox Macro | Excel Discussion (Misc queries) | |||
Macro for checkbox (2) | Excel Discussion (Misc queries) | |||
macro with checkbox(i) | Excel Programming | |||
VBA Macro - correlations in random number generation | Excel Programming |