+ Reply to Thread
Results 1 to 5 of 5

Unticking Checkboxes with VBA based on row

  1. #1
    Registered User
    Join Date
    05-01-2018
    Location
    Maine
    MS-Off Ver
    2010
    Posts
    77

    Unticking Checkboxes with VBA based on row

    Hello,

    I am not sure if this is possible but I wanted to check. I am trying to figure a VBA code that will untick a checkbox based on the selected row as opposed to defining which box based on its name. The worksheet I am using has 1 checkbox on multiple rows and I have a VBA code that will delete part of the row. However, when it deletes the cell with the checkbox it causes it to overlap with the checkbox above it.

    All in all I was wondering how to include something in VBA that will use the active row and just untick the checkbox without it being labeled 'checkbox 1' or similar?

  2. #2
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

    Re: Unticking Checkboxes with VBA based on row

    Quote Originally Posted by Darkcloud617 View Post
    However, when it deletes the cell with the checkbox it causes it to overlap with the checkbox above it.
    that's because excel automatically resizes its interface when a piece of the grid is removed, and the objects on top of the grid slide along with it.

    to untick a box, you can reference it in the controls collection, and the type it is, for instance:
    Please Login or Register  to view this content.
    I don't think there's anyway you can identify a box by the row number that it sits on top of because it is technically not part of the grid. a row is part of the grid.

  3. #3
    Registered User
    Join Date
    05-01-2018
    Location
    Maine
    MS-Off Ver
    2010
    Posts
    77

    Re: Unticking Checkboxes with VBA based on row

    I see. That makes sense. I noticed the same thing with other objects, like buttons. I wish there was a way to embed the checkbox into a cell to actually make it part of that cell. Thank you for the information. I will try adding the control part into my code.

  4. #4
    Banned User!
    Join Date
    02-06-2020
    Location
    Iowa City, IA, USA
    MS-Off Ver
    2016 - 365 / 2007
    Posts
    2,014

    Re: Unticking Checkboxes with VBA based on row

    I'm pretty sure I was right, as evidenced here:

    https://www.google.com/search?q=exce...eckbox+in+cell

    you may also not be aware that there are 2 types of controls in excel, be default. one group called ActiveX and the other, which I believe comes with VBA and is associated with that platform.

  5. #5
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    8,634

    Re: Unticking Checkboxes with VBA based on row

    What do you actually want to achieve...delete the row and the checkbox within the row or just uncheck the checkbox of active row...?
    delete part of the row
    you cannot delete part of a row...can delete and shift cells Up?

    This will delete the CheckBox of ActiveRow and then delete that row...
    Please Login or Register  to view this content.
    This will uncheck CheckBox of activeRow...

    Please Login or Register  to view this content.
    Or If change to True If false or False if True...
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by sintek; 09-23-2020 at 09:14 AM.
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere.....
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember......Mark Thread as Solved.
    Excel Forum Rocks!!!

+ 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] Checkboxes - How to check/uncheck other checkboxes based on another checkbox
    By brooklyn_87 in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 10-27-2017, 01:20 PM
  2. Replies: 4
    Last Post: 04-28-2013, 12:47 AM
  3. Print Sheets based on checkboxes in UserForm, Checkboxes also control another macro
    By krackaberr in forum Excel Programming / VBA / Macros
    Replies: 34
    Last Post: 03-05-2013, 11:12 AM
  4. Get checkboxes value based on row
    By didinside in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-16-2012, 08:15 AM
  5. Final tab based on checkboxes
    By billh0918 in forum Excel General
    Replies: 0
    Last Post: 01-20-2012, 11:54 AM
  6. Add/Remove Chart Data Series with ticking/unticking a box
    By OilMan in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-11-2010, 05:47 PM
  7. Sum Based on Checkboxes
    By Vassago in forum Excel General
    Replies: 6
    Last Post: 08-02-2006, 04:20 PM

Tags for this Thread

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