Conditions
Manage your personal finances in Excel
Thanks Thanks:  0
Likes Likes:  0
Results 1 to 5 of 5

Thread: Conditions

  1. #1
    Guest

    Default

     
    Hi all,

    I am creating a form and have two togglebuttons and a combobox. I want it so that if the first togglebutton is pressed, the list in the combobox stays the same, but if the 2nd togglebutton is selected, a different list comes up in the combobox.


    Can anyone help with this one?

  2. #2
    MrExcel MVP
    Join Date
    Feb 2002
    Location
    Newcastle, UK
    Posts
    1,174
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Is this a real form or 1 on the sheet itself using Controls Toolbox activex objects, if the latter then i can help you.

    Ian Mac

  3. #3
    Guest

    Default

    It's a form I designed myself using VBA

  4. #4
    Board Regular
    Join Date
    Feb 2002
    Location
    Where the wild roses grow
    Posts
    285
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    instead of filling the combobox on the userform.initialise event do it on the
    toggle button click event as follows:

    sub togglebutton1.click ()

    if togglebutton1.value = true then
    combobox1.clear
    combobox1.additem "something1"
    combobox1.additem "something2"
    combobox1.additem "something3"
    combobox1.additem "something4"
    end if

    end sub

    you need to clear the combobox first otherwise it will just keep adding to it.

  5. #5
    Guest

    Default

      
    Perfect! Thank you!

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

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

 

 
DMCA.com