+ Reply to Thread
Results 1 to 3 of 3

Hide/Unhide lies with 0 based on 3 columns - looking to exclude from running on headers

  1. #1
    Registered User
    Join Date
    04-12-2024
    Location
    London
    MS-Off Ver
    Ms Office 2021
    Posts
    1

    Exclamation Hide/Unhide lies with 0 based on 3 columns - looking to exclude from running on headers

    Hi Everyone ! great to meet you. I am relatively new to Macros, I am hoping someone can help me with a macro I am trying to run.

    I have attached my template to this thread and would really appreicate any tips, I am hoping it is relatively straight forward....


    I have set up the Macro currently to hide all of the rows within the worksheet where there are zero between columns E9-G.

    The Macro is working and is filtering out all of the 0 rows. However, I have rows which are there as they provide a header and these are being hidden as they do not contain value, I would like to stop these rows from hiding when I use the macro.

    The only complications is that there are instances where I do not wish for the headers to show and that is if everything underneath is 0.

    I basically want to keep the headers for where there is a catergory underneath the header which contains a value.

    I hope I am making sense with what I am trying to explain and really appreciate any support.


    Thanks
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    O365 32bit (Windows)
    Posts
    2,579

    Re: Hide/Unhide lies with 0 based on 3 columns - looking to exclude from running on header

    The Macro is working and is filtering out all of the 0 rows
    It's not working for me because the blank cells don't contain zeros and Header sometimes has a : after it.

    You could try it like this:

    Please Login or Register  to view this content.

  3. #3
    Valued Forum Contributor
    Join Date
    03-24-2020
    Location
    Thailand
    MS-Off Ver
    Office 2021
    Posts
    941

    Re: Hide/Unhide lies with 0 based on 3 columns - looking to exclude from running on header

    Hi there,

    Working from ByteMarks solution, it seems 'Headers' were hidden unless the row direct below had values.

    The code below will find the next 'Total' in column A and check if the value there is empty.
    We also check that Header rows are not in the row below (meaning no rows with data).

    This code is depended on Column 'A' is starting with 'Head' (Header) or 'Total'. I suspect the actual data may does not always contain these trigger words.


    Full code in attached file.

    Please Login or Register  to view this content.
    Attached Files Attached Files
    If your Question is answered; please mark it SOLVED. If you are happy with a member's solution, say 'Thanks' and click the 'Star' to Add Reputation.

+ 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] VBA to hide Multiple Columns based on Headers
    By FvdF in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-01-2020, 02:46 PM
  2. VBA to hide and unhide columns based on 2 criteria
    By Oliver1470 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 01-21-2019, 04:33 PM
  3. hide and unhide columns based on cell value
    By darijokesar in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 11-29-2014, 03:51 AM
  4. [SOLVED] Hide columns based on dynamic headers
    By pdalal in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-19-2013, 03:21 AM
  5. [SOLVED] Hide/Unhide Columns based on Cell Value
    By dberg in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 07-26-2013, 03:36 PM
  6. Hide/Unhide columns based on value of a cell
    By redrackham in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 09-24-2011, 09:14 AM
  7. Hide & Unhide columns based on a cell value
    By DaveNUFC in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 02-21-2010, 09:40 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