+ Reply to Thread
Results 1 to 15 of 15

VBA square option buttons with check marks

  1. #1
    Forum Contributor
    Join Date
    10-03-2012
    Location
    USA
    MS-Off Ver
    2010
    Posts
    496

    VBA square option buttons with check marks

    Hello,
    I try to make option buttons instead of round with a black dot but square box with check mark
    liked the check box. Box can be filled with color (light blue or other color). When the box is picked
    the fill change to white background.

    I have 5 option boxs, I like to group them in one group because I have other groups using the
    option boxs. I want the check mak stayed in that group when it is picked.


    Thanks
    Last edited by Rocky2013; 02-11-2014 at 01:28 PM.

  2. #2
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: VBA square option buttons with check marks

    Create a frame box and Keep all the check boxes inside the frame


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  3. #3
    Forum Contributor
    Join Date
    10-03-2012
    Location
    USA
    MS-Off Ver
    2010
    Posts
    496

    Re: VBA square option buttons with check marks

    Hi Sixthsense,
    I can group them using VBA to group the form buttons. My main attempt is how to create option boxs with check marks
    with variable color background. Any thought?

    For example for option boxs: There are 5 check boxs, if I pick box2, a check mark will be checked. Next if I pick a box1, a check mark will be checked
    then box2 will be unchecked. I like to make checked boxs and option buttons looks the same in the spread sheet.

    Thanks

  4. #4
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: VBA square option buttons with check marks

    Attach a sample workbook. Make sure there is just enough data to make it clear what is needed. Include a BEFORE sheet and an AFTER sheet in the workbook if needed to show the process you're trying to complete or automate. Make sure your desired results are demonstrated, mock them up manually if needed. Remember to desensitize the data.

    Click on GO ADVANCED and use the paperclip icon to open the upload window.

    View Pic

  5. #5
    Forum Contributor
    Join Date
    10-03-2012
    Location
    USA
    MS-Off Ver
    2010
    Posts
    496

    Re: VBA square option buttons with check marks

    Hi,
    Attached is the sample file. Hope you can make it work.

    Thanks
    Attached Files Attached Files

  6. #6
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: VBA square option buttons with check marks

    This will not match regular UI design. However you may assign this code to your checkboxes - based on the names in your sample workbook:
    Please Login or Register  to view this content.
    • Please remember to mark threads Solved with Thread Tools link at top of page.
    • Please use code tags when posting code: [code]Place your code here[/code]
    • Please read Forum Rules

  7. #7
    Forum Contributor
    Join Date
    10-03-2012
    Location
    USA
    MS-Off Ver
    2010
    Posts
    496

    Re: VBA square option buttons with check marks

    Hi Izandol,
    Thanks for the code. I am not sure how this work. What I did is to modify the sample
    to show only one style. I also rename the check box to 1, 2, 3, 4, 5. However I could not
    change one of the check box 13 to Check Box 3. I use the name list from upper-left to rename.

    Could please modify the attachment. Basicly Iwhat I need is to create option button using check
    marks in a square box liked the check box. Then I group the check boxs from 1 to 5.


    Thanks
    Attached Files Attached Files
    Last edited by Rocky2013; 02-10-2014 at 09:23 PM.

  8. #8
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: VBA square option buttons with check marks

    Here is modified attachment.
    Attached Files Attached Files

  9. #9
    Forum Contributor
    Join Date
    10-03-2012
    Location
    USA
    MS-Off Ver
    2010
    Posts
    496

    Re: VBA square option buttons with check marks

    Thanks. It works but ...

    1. How can I have all shaedd check boxs start without any check marks?
    2. How to shaded and unshaded the boxs?
    3. How to change the shade color? Box will be filled in light blue R:220, G:230, B:241
    4. How to uncheck the box which already has a check mark to return to a shaded box without check mark?
    (e.g., click once to add check mark without any shade, click again to uncheck with shaded box)
    5. Is that possible to have a shaded checked box with a check mark, once the mouse pointer move away fron the check box? (nice to have) **
    6. How do you change the box 13 to box 3? (lession & learn)



    Your code looks very simple. I could not figure out how to unshade the box and change the shade color.
    I make it more complicate which I did not see at the beginning until seeing in action.

    I am very appreciate your help.

    Regards,

    Rocky2013
    Last edited by Rocky2013; 02-11-2014 at 10:27 AM.

  10. #10
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: VBA square option buttons with check marks

    It is not possible to change shade colour.

  11. #11
    Forum Contributor
    Join Date
    10-03-2012
    Location
    USA
    MS-Off Ver
    2010
    Posts
    496

    Re: VBA square option buttons with check marks

    Izandol,
    I just update my reply after your reply. How do yo get a shaded box at the first place.
    When I insert the check box, it have no shade, when I fill with color, only the area outside
    the box was shaded.

    Thanks

  12. #12
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: VBA square option buttons with check marks

    You must set Value to Mixed.

  13. #13
    Forum Contributor
    Join Date
    10-03-2012
    Location
    USA
    MS-Off Ver
    2010
    Posts
    496

    Re: VBA square option buttons with check marks

    How about click the "checked box" again to remove check mark?

  14. #14
    Forum Guru Izandol's Avatar
    Join Date
    03-29-2012
    Location
    *
    MS-Off Ver
    Excel 20(03|10|13)
    Posts
    2,581

    Re: VBA square option buttons with check marks

    I will suggest you use a button to uncheck all checkboxes. It will be much simpler.

  15. #15
    Forum Contributor
    Join Date
    10-03-2012
    Location
    USA
    MS-Off Ver
    2010
    Posts
    496

    Re: VBA square option buttons with check marks

    Ok. That is good enough.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Printing using Option Buttons and Check Boxes
    By jordan2322 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-16-2012, 05:34 PM
  2. Check boxes and Option buttons
    By Chris Martin in forum Excel General
    Replies: 2
    Last Post: 05-15-2009, 04:21 AM
  3. option buttons or check boxes
    By meandmyindigo via OfficeKB.com in forum Excel - New Users/Basics
    Replies: 2
    Last Post: 08-07-2006, 08:00 AM
  4. Option Buttons-allows users to check yes / No
    By Grant90 in forum Excel General
    Replies: 1
    Last Post: 07-29-2005, 10:05 AM
  5. [SOLVED] option buttons/check boxes are shifting
    By Dan in forum Excel General
    Replies: 2
    Last Post: 07-27-2005, 01:06 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1