Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default 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,

I have 2 checkboxes (forms) on a chart. I would like to have just one
checkbox checked at anytime. I know a radiobutton would do the same but I
need only 2 checkboxes since they don't fall into a single category. What

do
I have to do to achieve this? I tried to group them but it doesn't help.

How
do I write code for this? Also is it possible to change the names of these
checkboxes from checkboxN to something else?

Please help.

Regards,
Ram



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Forms control checkboxes on charts

Hi Dave and Tom,

Thanks a lot for that help. I was able to achieve what I wanted t
without any problems. BTW what useful purpose does it serve to grou
checkboxes?

Regards,
Ra

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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,824
Default Forms control checkboxes on charts

Prettiness???

Kind of shows what's related--like Tools|Option|View tab.



"routeram <" wrote:

Hi Dave and Tom,

Thanks a lot for that help. I was able to achieve what I wanted to
without any problems. BTW what useful purpose does it serve to group
checkboxes?

Regards,
Ram

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


--

Dave Peterson

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I add a control check box to control other checkboxes? JGarland Excel Worksheet Functions 1 September 18th 08 12:26 PM
Forms - Checkboxes Jane Excel Worksheet Functions 3 October 3rd 06 02:21 PM
Forms control checkboxes on charts routeram Excel Programming 1 September 13th 04 12:38 AM
Forms control checkboxes on charts Dave Peterson[_3_] Excel Programming 1 September 13th 04 12:12 AM
Can you hide forms checkboxes Matt Excel Programming 2 January 10th 04 06:32 PM


All times are GMT +1. The time now is 12:15 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"