Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Creation and property manipulation of Control Checkbox using VB
I have created a tool that allows the user to import specific data from a
related spreadsheet. This data gets pasted into the next open row in a table in the open spreadsheet. I'm looking for a method to create a new control checkbox in the rightmost column whenever a new row is created in the table. I'd also like to manipulate the properties of the button, for instance link the button to the cell beneath, set the size of the button to be the same as the linked cell, change the button's colour and caption etc. Any hints would be greatly appreciated -- BRG |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Creation and property manipulation of Control Checkbox using VB
Here is some quick and dirty code to get you started...
Dim ctl As OLEObject Set ctl = activesheet.OLEObjects.Add(ClassType:="Forms.Check Box.1") ctl.TopLeftCell = ActiveCell ctl.Object.Caption = "Tada" -- HTH... Jim Thomlinson "BRG" wrote: I have created a tool that allows the user to import specific data from a related spreadsheet. This data gets pasted into the next open row in a table in the open spreadsheet. I'm looking for a method to create a new control checkbox in the rightmost column whenever a new row is created in the table. I'd also like to manipulate the properties of the button, for instance link the button to the cell beneath, set the size of the button to be the same as the linked cell, change the button's colour and caption etc. Any hints would be greatly appreciated -- BRG |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Creation and property manipulation of Control Checkbox using V
Hey Jim,
Thanks for the tip, that was what I was looking for. Just a quick question out of curiosity, the checkboxes that are created with this code are different than the checkboxes that I create using the controls toolbar, for instance I can't right click on these checkboxes to access their properties. In the code you sent the class type is "Forms.CheckBox.1". Is this actually equivalent to a Forms checkbox? And if so how do you create a "Controls" checkbox? Thanks, -- BRG "Jim Thomlinson" wrote: Here is some quick and dirty code to get you started... Dim ctl As OLEObject Set ctl = activesheet.OLEObjects.Add(ClassType:="Forms.Check Box.1") ctl.TopLeftCell = ActiveCell ctl.Object.Caption = "Tada" -- HTH... Jim Thomlinson "BRG" wrote: I have created a tool that allows the user to import specific data from a related spreadsheet. This data gets pasted into the next open row in a table in the open spreadsheet. I'm looking for a method to create a new control checkbox in the rightmost column whenever a new row is created in the table. I'd also like to manipulate the properties of the button, for instance link the button to the cell beneath, set the size of the button to be the same as the linked cell, change the button's colour and caption etc. Any hints would be greatly appreciated -- BRG |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Enable Property of Multipage Control Pages = CheckBox.Value | Excel Programming | |||
checkbox property | Excel Programming | |||
.onaction property for controls checkbox | Excel Programming | |||
Programatically control picture property of Image control | Excel Programming | |||
Conditional Checkbox Creation on a UserForm | Excel Programming |