Consulting

Results 1 to 3 of 3

Thread: Check/Uncheck all checkboxes with VBA

  1. #1

    Check/Uncheck all checkboxes with VBA

    Hello everyone I am very new in website and Office 2007 Ribbon UI
    I add two checkBoxes in the ribbon using xml (with Custom UI Editor for Microsoft Office) ,They execute vba code called KOLONAC and it works fine.What I need that is to check/uncheck all checkBoxes with another sub. My xml codes :
    HTML Code:
    <checkBox id ="F20"  label="F2"     tag="F20"     getPressed="GetPressed" onAction="KOLONAC" />
    <checkBox id ="F21"  label="F21" tag="F21"  getPressed="GetPressed"   onAction="KOLONAC" />
    And I need to put some extra code inside of this sub to uncheck all checkboxes

     Sub Button29_Click(control As IRibbonControl)
          Sheets("Main Sheet").Columns("B:ZZ").Hidden = True
    'some code too add here to uncheck all checkboxes
              End Sub
    I will be really really happy if you help me.

  2. #2
    VBAX Wizard
    Joined
    Apr 2007
    Posts
    6,793
    Location
    1. Your XML will need the onLoad to set a VBA IRibbon object (e.g. oRibbon)

    2. I'd keep the check box status in a Boolean bF20, bF21, etc. so you need to change KOLONAC

    3. Inside Button29_CLick I'd add

    bF20 = False
    bF21 = False
    ...

    oRibbon.Invalidate



    Here's something that uses TobbleButtons, but the concept is the same

    http://www.vbaexpress.com/forum/show...ssing-anywhere
    Paul

    ------------------------------------------------------------------------------------------------------------------------
    1. Use [CODE] ....[/CODE ] Tags for readability
    [CODE]PasteYourCodeHere[/CODE ] -- (or paste your code, select it, click [#] button)
    2. Upload an example
    Go Advanced / Attachments - Manage Attachments / Add Files / Select Files / Select the file(s)
    (multiple files can be selected while holding Ctrl key) / Upload Files / Done
    3. Mark the thread as [Solved] when you have an answer
    Thread Tools (on the top right corner, above the first message)
    4. Read the Forum FAQ, especially the part about cross-posting in other forums
    http://www.vbaexpress.com/forum/faq...._new_faq_item3

  3. #3
    VBAX Regular
    Joined
    Jan 2016
    Posts
    7
    Location
    Tanks for help!

Posting Permissions

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