+ Reply to Thread
Results 1 to 2 of 2

Create an active X button that hides rows that have "0" qty values

  1. #1
    Registered User
    Join Date
    09-10-2022
    Location
    Florida
    MS-Off Ver
    Microsoft 360 Version 2208
    Posts
    1

    Question Create an active X button that hides rows that have "0" qty values

    I am a lighting designer for an event venue.

    I have an excel document that is an equipment list I use to generate Request for Quotes to submit to vendors.

    Essentially its a long list of every possible light, cable, power distro possible.

    I fill in qtys, then manually hide rows that are not used for a specific list. Its really tedious and prone to user selection errors currently.

    I have an example file here, with the button and the code I have been trying to use.


    Private Sub CommandButton1_Click()

    For a = 23 To 609

    If Worksheets("Typical").Cells(a, 24).Value = "0" Then

    Worksheets("Typical").Rows(a).Hidden = True

    End If

    Next

    End Sub



    This code is not working as I would like currently.

    There are also row headers that I would also like the ability to hide with the same button if inactive. They have 0 values in the q column instead of the a column as a normal line item would.

    Any help/advice greatly appreciated. I've used excel all my life, but basically only on a surface level.

    I believe I have attached an example file.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,519

    Re: Create an active X button that hides rows that have "0" qty values

    Here you're checking Column 24 (Column X) which is totally empty.
    You also indicate zero (0) as text because of the double quotes. On purpose or by accident?
    Please Login or Register  to view this content.
    Instead of putting a zero in a cell for hiding a row, would it not be easier to hide if all cells (in either Column A or B or maybe both) in that block have a zero?

    BTW, Do not use "Merge and Center" It is an accident waiting to happen.
    https://officemastery.com/_merge-and...r-alternative/
    https://edu.gcfglobal.org/en/excel-t...rging-cells/1/
    https://itstraining.wichita.edu/exce...n-alternative/
    Experience trumps academics every day of the week and twice on Sunday.

+ 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. Replies: 7
    Last Post: 10-29-2021, 11:31 PM
  2. [SOLVED] Add "comments" box pop up when the user "mouses over" an active-x command button.
    By mmcap64 in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-09-2020, 09:32 PM
  3. How to change font size on an Active X controll button ("Command Button")
    By luv2glyd in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 04-08-2017, 06:12 PM
  4. Macro to export active worksheet as a pdf with "fit all rows on one page" active
    By NickyHavey in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 06-06-2016, 11:06 AM
  5. Create a Command Button to "Save As" and "Close" an Excel Workbook
    By thedunna in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 05-26-2013, 05:38 PM
  6. [SOLVED] Speeding up Macro that Hides Rows when Range ("B178:B477") contains a zero value
    By SoteriaLive in forum Excel Programming / VBA / Macros
    Replies: 28
    Last Post: 09-26-2012, 04:02 PM
  7. Replies: 2
    Last Post: 09-29-2010, 03:28 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