Results 1 to 5 of 5
  1. #1
    Star Lounger
    Join Date
    Nov 2005
    Location
    London, Gtr London, United Kingdom
    Posts
    88
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Not too sure how to title this (VBA/Powerpoint/2000)

    I'm not too sure how to title this, but basically i'm pulling all my bits of code together from my userform and other places. My userform is a series of toggleboxes (30 in total!!!) and a few check boxes.

    Private Sub cmdOK_Click()
    If ToggleButton01 = True And CheckBox1 = True Then
    frmCCharts.Hide
    Call InsertChart
    Call PieType(9, 3, 7, 38, 35) 'ColorIndex Reference
    ElseIf ToggleButton26 = True And CheckBox2 = True Then
    frmCCharts.Hide
    Call InsertChart
    Call PieType(3, 6, 9, 22, 10) 'ColorIndex Reference
    End If
    Unload frmFrontCover
    etc. etc. for the next checkbox
    End Sub

    this is just very roughly written, but I can all ready see that this could be a nightmare bit of code for 30 toggle buttons and a few checkboxes.

    Any advice on how it may be possible to simplify it would be greatly appreciated. I've attached a jpeg of the userinterface to give people an idea. (the form automatically expands depending on which toggle is depressed)

    Regards

    Thom

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 16 Times in 16 Posts

    Re: Not too sure how to title this (VBA/Powerpoint/2000)

    You have used check boxes for Left, Center and Right. That means that the user can tick any combination of them. Is that what you intended? If you want an exclusive choice, you should use option buttons (radio buttons).

  3. #3
    Star Lounger
    Join Date
    Nov 2005
    Location
    London, Gtr London, United Kingdom
    Posts
    88
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Not too sure how to title this (VBA/Powerpoint/2000)

    Thanks Hans.

    I was only now thinking of that, although i'd put in a bit of code to allow only one of the three to be selectable able at any one time. but radio buttons would be much cleaner

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 16 Times in 16 Posts

    Re: Not too sure how to title this (VBA/Powerpoint/2000)

    You could use Select Case statements. Still a mess, but slightly more structured. Is there some way you can separate the code for the toggle buttons from that for the radio buttons, or are they inextricably interwoven?

  5. #5
    Star Lounger
    Join Date
    Nov 2005
    Location
    London, Gtr London, United Kingdom
    Posts
    88
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Not too sure how to title this (VBA/Powerpoint/2000)

    I think I see what you mean.

    Using the OptionButton Control, I can put the true/false argument into the InserChart sub, which will tidy up the cmdOK no end

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •