+ Reply to Thread
Results 1 to 10 of 10

Hide multiple ActiveX checkboxes with name as variable when a cell is returning blank

  1. #1
    Registered User
    Join Date
    10-06-2017
    Location
    UK
    MS-Off Ver
    2013
    Posts
    16

    Hide multiple ActiveX checkboxes with name as variable when a cell is returning blank

    Hello, people!

    I have a problem with ActiveX checkboxes. I have a formulas on column G which sometimes return blank based on a criteria. I have ActiveX checkboxes next to each cell on the next column (H). I want those ActiveX checkboxes to be hidden then the formula in the adjacent cell on column G returns blank. The checkboxes are named cbWin1, cbWin2,... and so on. This is the code I've tried and it doesn't work:

    Please Login or Register  to view this content.

    Any ideas!

    Thanks a lot!

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482

    Re: Hide multiple ActiveX checkboxes with name as variable when a cell is returning blank

    This will hide or unhide the checkbox next to the target.

    Take note formula changes do not affect worksheet_change events

    Please Login or Register  to view this content.

  3. #3
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,151

    Re: Hide multiple ActiveX checkboxes with name as variable when a cell is returning blank

    And that below is exactly for one line with a change in "G" to blank cell, but the index of the given "cbWin" must correspond to the given line, i.e. if Target.Row = 2, then the corresponding checkbox must be "cbWin2":
    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    10-06-2017
    Location
    UK
    MS-Off Ver
    2013
    Posts
    16

    Re: Hide multiple ActiveX checkboxes with name as variable when a cell is returning blank

    Thanks, guys, for the quick replies.

    I daveexcel's solution with Worksheet_Calculate() instead of Change, and I get a 424 object required error on the first line. Porucha's returns the same error on the same line, the If Target one.

    I need the checkboxes to disappear when the formula returns a blank. Actual changes to the source that modifies the result happen in a different sheet.

    Any ideas?


    Thanks!

  5. #5
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,151

    Re: Hide multiple ActiveX checkboxes with name as variable when a cell is returning blank

    Quote Originally Posted by cristihendrix View Post
    and I get a 424 object required error on the first line
    at my place it works, below is a screen in mp4 file (works with mpc-hc player)
    Attached Files Attached Files

  6. #6
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482

    Re: Hide multiple ActiveX checkboxes with name as variable when a cell is returning blank

    Here you can loop through the checkboxes, you can determine if the value will be "Blank" or "0"
    All in the worksheet "Sheet1" module

    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    10-06-2017
    Location
    UK
    MS-Off Ver
    2013
    Posts
    16

    Re: Hide multiple ActiveX checkboxes with name as variable when a cell is returning blank

    Works perfectly!

    Thanks Porucha, thanks davesexcel! You're great!

  8. #8
    Registered User
    Join Date
    10-06-2017
    Location
    UK
    MS-Off Ver
    2013
    Posts
    16

    Re: Hide multiple ActiveX checkboxes with name as variable when a cell is returning blank

    Sorry guys, I just realised that davesexcel method, which I've used, doesn't work when I have other checkboxes in other columns. I need these other checkboxes to be hidden when the formula in the G column returns blank. So all the checkboxes have to be connected to the G column, not to the column just left of the checkbox.

    Can that be done?

    Thank you!

  9. #9
    Forum Expert
    Join Date
    10-06-2017
    Location
    drevni ruchadlo
    MS-Off Ver
    old
    Posts
    2,151

    Re: Hide multiple ActiveX checkboxes with name as variable when a cell is returning blank

    All checkboxex in the whole sheet, or just these which correspond to their position with rows with empty cells in column 'G'?
    what's your excel spreadsheet look like ?

  10. #10
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482

    Re: Hide multiple ActiveX checkboxes with name as variable when a cell is returning blank

    This will first check if the controls are in column 7
    Please Login or Register  to view this content.

+ 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] Hide Axtivex Checkboxes if cell value is less Than 1 (Multiple)
    By How How in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-24-2017, 05:45 AM
  2. [SOLVED] hide rows if cell value is zero or blank in one or multiple columns.
    By yatin1964 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-08-2016, 11:11 PM
  3. Add Checkboxes (ActiveX) to worksheet if Cells are NOT blank
    By Andrewstupendo in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 01-31-2016, 09:55 AM
  4. [SOLVED] My ActiveX Checkboxes won't hide when the row is hidden
    By Angelammarten in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 11-20-2014, 05:42 PM
  5. Formula for reviewing multiple cells and returning variable into a new cell
    By charlee808 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 09-19-2013, 03:38 PM
  6. Hide multiple checkboxes when a row is hidden
    By daniva92 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 09-11-2013, 10:20 AM
  7. Hide/Unhide Multiple Checkboxes
    By LampCommandr in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-30-2011, 09:35 AM

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