ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Forms control checkboxes on charts (https://www.excelbanter.com/excel-programming/309702-re-forms-control-checkboxes-charts.html)

routeram

Forms control checkboxes on charts
 
Hi,

Please help. Still have no idea about how to proceed.

Regards,
Ra

--
Message posted from http://www.ExcelForum.com


Tom Ogilvy

Forms control checkboxes on charts
 
Assign this code to both checkboxes.

Sub cbox_Click()
Dim sName As String, cbox1 As CheckBox
Dim cbox2 As CheckBox
sName = Application.Caller
If LCase(sName) = "check box 1" Then
Set cbox2 = ActiveChart.CheckBoxes("Check box 2")
Else
Set cbox2 = ActiveChart.CheckBoxes("Check box 1")
End If
Set cbox1 = ActiveChart.CheckBoxes(sName)
If cbox1 = xlOn Then
cbox2 = xlOff
Else
' comment out if both can be unchecked.
cbox2 = xlOn
End If
End Sub


if you select the checkbox, then you can rename it in the namebox.
(highlight the current name and type in a new name. You would need to
adjust the code above to match the names.

--
Regards,
Tom Ogilvy



"routeram " wrote in message
...
Hi,

Please help. Still have no idea about how to proceed.

Regards,
Ram


---
Message posted from http://www.ExcelForum.com/





All times are GMT +1. The time now is 07:50 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com