+ Reply to Thread
Results 1 to 21 of 21

Active X Checkboxes keep resizing

  1. #1
    Registered User
    Join Date
    02-27-2019
    Location
    Netherlands
    MS-Off Ver
    Office 365
    Posts
    70

    Active X Checkboxes keep resizing

    Hello,

    I have an excel sheet with a dozen of checkboxes and when i click them they resize. I know this is a common problem and there are a lot of posts with very dificult vba sollutions. But those solutions are all from 2009 to 2014 so i was wondering if maybe there is a more simple sollution in the new versions of Excel(office 365).

    Tx!
    Attached Files Attached Files
    Last edited by Afjio12; 04-18-2019 at 03:16 AM.

  2. #2
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,302

    Re: Active X Checkboxes keep resizing

    I found this to be the case if the checkboxes when originally placed on the sheet touched or slightly overlapped cell boundaries.
    When initially placing ensure totally contained in cell and slightly smaller than cell.
    In the distant past I plagiarised the attached code from a website (i cannot remember ?????)
    I have used it on many occasions and never experienced further problems.
    It works for both 'Form' & 'ActiveX' used on sheets - Form checkboxes in col 'A' - ActiveX in col 'I'
    Hope this helps.
    torachan.
    Attached Files Attached Files

  3. #3
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Active X Checkboxes keep resizing

    You're better off not using ActiveX controls on worksheets at all. They're incredibly unstable have a look here https://www.google.co.uk/webhp?sourc...eet%20controls and by using them, you're asking for trouble.

    Forms controls are much more reliable - they're in the same dropdown as the ActiveX ones, but are designed for use on worksheets - so you don't run into any stability issues, you can do most of the same things with them too and you can use them without using code.

  4. #4
    Registered User
    Join Date
    02-27-2019
    Location
    Netherlands
    MS-Off Ver
    Office 365
    Posts
    70

    Re: Active X Checkboxes keep resizing

    Yeah i know but with the form controls i can only assign a macro to it when you check the checkbox. I need 1 macro when checked and 1 macro when unchecked.

  5. #5
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Active X Checkboxes keep resizing

    Just run the same macro and check whether it is ticked

  6. #6
    Registered User
    Join Date
    02-27-2019
    Location
    Netherlands
    MS-Off Ver
    Office 365
    Posts
    70

    Re: Active X Checkboxes keep resizing

    Well i added an excel sheet to show my problem. If you have another sollution that would be awesome. But 2 checkboxes(1 for highlight and 1 for remove highlight is no option because in the real spreadsheet there is no space left.)

  7. #7
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Active X Checkboxes keep resizing

    There's no code in that workbook, however, I'm not sure why you'd need 2 checkboxes, consider:
    Please Login or Register  to view this content.
    Though you could do it with conditional formatting of course and skip the macros altogether

  8. #8
    Registered User
    Join Date
    02-27-2019
    Location
    Netherlands
    MS-Off Ver
    Office 365
    Posts
    70

    Re: Active X Checkboxes keep resizing

    Does conditional formatting work with checkboxes?

  9. #9
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Active X Checkboxes keep resizing

    Yes, you base it on the linked cell

  10. #10
    Registered User
    Join Date
    02-27-2019
    Location
    Netherlands
    MS-Off Ver
    Office 365
    Posts
    70

    Re: Active X Checkboxes keep resizing

    That would be an option but it is too much work. There are over 500 cells to be formatted

  11. #11
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Active X Checkboxes keep resizing

    How is a macro less work?

    Can you post the code you have?

  12. #12
    Forum Expert torachan's Avatar
    Join Date
    12-27-2012
    Location
    market harborough, england
    MS-Off Ver
    Excel 2010
    Posts
    4,302

    Re: Active X Checkboxes keep resizing

    I was NOT actively recommending ActiveX checkboxes.
    Just stating that the only time I have had a problem is when they are not cell contained.
    Looking at Afjio12 sheet the checkbox is randomly 'plonked' on the sheet, is it a case of a self-inflicted problem.
    Indeed since discovering this even if I use ComboBoxes or Command buttons on a sheet I always contain them within a cell.
    Although my preferred approach where ever possible is to use the 'UserForm' for any VBA interface.
    torachan.

  13. #13
    Registered User
    Join Date
    02-27-2019
    Location
    Netherlands
    MS-Off Ver
    Office 365
    Posts
    70

    Re: Active X Checkboxes keep resizing

    @Kyle123,

    The only code i have is the code withing the checkbox to call the macro's.

  14. #14
    Registered User
    Join Date
    02-27-2019
    Location
    Netherlands
    MS-Off Ver
    Office 365
    Posts
    70

    Re: Active X Checkboxes keep resizing

    @torachan,

    In my real workbook i placed the checkboxes within a cell and the problem still occurs. I now see that you need to avoid using axtive x controls but i just can't get two macro's assigned to 1 userform checkbox

  15. #15
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Active X Checkboxes keep resizing

    That you still haven’t posted....

    It’s less code to use forms controls than active controls

  16. #16
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Active X Checkboxes keep resizing

    Without posting your code, you aren’t going to get an answer

  17. #17
    Registered User
    Join Date
    02-27-2019
    Location
    Netherlands
    MS-Off Ver
    Office 365
    Posts
    70

    Re: Active X Checkboxes keep resizing

    I have no idea why but the code and macro's disapeared in my workbook. I uploaded a new one in my original post. Sorry for the confusion

  18. #18
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Active X Checkboxes keep resizing

    Here's how to do it with regular checkboxes, not activeX
    Please Login or Register  to view this content.
    You just assign that macro to all the checkboxes

    I've attached a working example
    Attached Files Attached Files
    Last edited by Kyle123; 04-18-2019 at 03:35 AM.

  19. #19
    Registered User
    Join Date
    02-27-2019
    Location
    Netherlands
    MS-Off Ver
    Office 365
    Posts
    70

    Re: Active X Checkboxes keep resizing

    Ah that's awesome i didn't know that was possible. Tx!

  20. #20
    Forum Guru Kyle123's Avatar
    Join Date
    03-10-2010
    Location
    Leeds
    MS-Off Ver
    365 Win 11
    Posts
    7,238

    Re: Active X Checkboxes keep resizing

    Glad you got it sorted, thanks for the rep

  21. #21
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Active X Checkboxes keep resizing

    and then you can add code to react to the form you clicked (rather than a fixed set of ranges)

    here's the same book with 100 checkbox coloring the offset if true/false
    Attached Files Attached Files
    Last edited by humdingaling; 04-18-2019 at 04:23 AM. Reason: working on file before it got resolved... so posting it anyway
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

+ 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. [SOLVED] Resizing checkboxes using vba
    By jrooney7 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-31-2018, 02:16 PM
  2. Active x buttons keep moving and resizing
    By superchew in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 06-03-2015, 06:14 PM
  3. active x buttons randomly resizing and moving
    By superchew in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 05-15-2015, 03:03 PM
  4. [SOLVED] Active X Checkboxes
    By TimlmiT in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-26-2013, 01:01 PM
  5. Resizing Text Associated with Checkboxes
    By smlaff01 in forum Excel General
    Replies: 1
    Last Post: 04-21-2008, 04:23 PM
  6. Resizing Checkboxes?
    By smlaff01 in forum Excel General
    Replies: 0
    Last Post: 04-03-2008, 08:38 AM

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