First off, let me apologize because I'm a complete newbie when it comes to programming in Excel.
I'm trying to insert a row that includes a checkbox (centered in the cell) that has it's linked cell adjacent to it. I've been able to cobble together the code to make this happen. The problem I'm having is that the height of the newly created checkbox is larger than that of the row, so that when the macro is called again, it distorts the checkbox above. Below is the code that I have so far:
I've attempted to modify the top and height, but I can't get a satisfactory result. Any help in trying to get the checkbox to fit within the row height?![]()
Range("AddCheckbox").Select ActiveCell.Offset(-1, 0).Select Dim MyLeft As Double Dim MyTop As Double Dim MyHeight As Double Dim MyWidth As Double MyLeft = ActiveCell.Left + 26.5 MyTop = ActiveCell.Top MyHeight = ActiveCell.Height MyWidth = 14 ActiveSheet.CheckBoxes.Add(MyLeft, MyTop, MyWidth, MyHeight).Select With Selection .Caption = "" .Value = xlOff .LinkedCell = "C" & ActiveCell.Row .Display3DShading = False .PrintObject = True End With
Please let me know if you need any further info and I'll try to answer to the best of my ability.
Thanks.











LinkBack URL
About LinkBacks
Register To Reply
Bookmarks