Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
linkedcell with togglebuttons problem
I used to use checkboxes, but a coworker of mine told me about
togglebuttons - so I'm wondering how I change the following code to work with togglebuttons instead of checkboxes: _____________________________ Sub chkb() Dim RngChckBox Set RngChckBox = Range("A1") ActiveSheet.CheckBoxes.Add(RngChckBox.Left, RngChckBox.Top, RngChckBox.Width, RngChckBox.Height).Select With Selection .LinkedCell = "'Sheet2'!" & RngChckBox.Address .Characters.Text = "Test" .OnAction = "msg" End With End Sub Sub msg() MsgBox "Test works" End Sub _____________________________ I have due to a lot of searching found out how to create togglebuttons like this: _____________________________ Sub tgbtn() Dim RngTgnBtn Set RngLink = Range("F2") Set RngTgnBtn = Range("E8:F9") ActiveSheet.OLEObjects.Add("Forms.ToggleButton.1", , , , , , , RngTgnBtn.Left, RngTgnBtn.Top, RngTgnBtn.Width, RngTgnBtn.Height).Select 'With Selection '.LinkedCell = RngLink.Address '.Characters.Text = "Test" '.OnAction = "msg" 'End With End Sub _____________________________ But I have no idea how I change the linkedcell :( Any help is appreciated! |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
LinkedCell problem | Excel Programming | |||
Togglebuttons in a Userform. | Excel Programming | |||
Moving togglebuttons | Excel Discussion (Misc queries) | |||
Linkedcell protection problem | New Users to Excel | |||
change the value of togglebuttons | Excel Programming |