+ Reply to Thread
Results 1 to 16 of 16

hide rows based on two columns

  1. #1
    Forum Contributor
    Join Date
    06-02-2019
    Location
    libya
    MS-Off Ver
    2010
    Posts
    734

    hide rows based on two columns

    hi
    i have this code but if on of them value is 0 then hide rows but what i want if in col b,c =0 then hide so if on of them 0 and another not 0 it shouldn't hide rows
    HTML Code: 

  2. #2
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,078

    Re: hide rows based on two columns

    How about
    Please Login or Register  to view this content.

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

    Re: hide rows based on two columns

    hide rows based on two columns
    Am I missing something...None of the above code is actually doing this...False TO True Perhaps
    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!!!

  4. #4
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,078

    Re: hide rows based on two columns

    Oops, didn't look at that bit of the code, it should indeed be True not False

  5. #5
    Forum Contributor
    Join Date
    06-02-2019
    Location
    libya
    MS-Off Ver
    2010
    Posts
    734

    Re: hide rows based on two columns

    hi, fluff and sintek you're right about true not false i changed to false to show rows and change to true to test my code
    for code fluff you misunderstood i want if col b and c together are 0 it still hide row if one of them =0 not together=0

  6. #6
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,078

    Re: hide rows based on two columns

    Do you have real numbers in both columns, or numbers stored as text?

  7. #7
    Forum Contributor
    Join Date
    06-02-2019
    Location
    libya
    MS-Off Ver
    2010
    Posts
    734

    Re: hide rows based on two columns

    numbers not text

  8. #8
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,078

    Re: hide rows based on two columns

    In that case after swithching the False to True, the code in post#2 works.
    Unless you have blank cells which will be treated as 0

  9. #9
    Forum Contributor
    Join Date
    06-02-2019
    Location
    libya
    MS-Off Ver
    2010
    Posts
    734

    Re: hide rows based on two columns

    it doesn't work as i want this is my file it supposses hide only row2,3 but it hide also row4 you can check it
    Attached Files Attached Files

  10. #10
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,078

    Re: hide rows based on two columns

    That's because you are not using the code I supplied.

  11. #11
    Forum Contributor
    Join Date
    06-02-2019
    Location
    libya
    MS-Off Ver
    2010
    Posts
    734

    Re: hide rows based on two columns

    sorry about change range (b2: c250) not your code i though not work that's why i changed now the code really works
    thanks so much

  12. #12
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,078

    Re: hide rows based on two columns

    You're welcome & thanks for the feedback.

  13. #13
    Forum Contributor
    Join Date
    06-02-2019
    Location
    libya
    MS-Off Ver
    2010
    Posts
    734

    Re: hide rows based on two columns

    hi fluff , is there any way to do more fast that without loop? because if i have empty rows the code passes on them and it takes time

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

    Re: hide rows based on two columns

    If there are blank cells within the range...Try
    Please Login or Register  to view this content.
    Or if there are blank rows from a specific cell to end then just reduce the range to include lastrow...
    Or use filter if you have a big dataset...

  15. #15
    Forum Contributor
    Join Date
    06-02-2019
    Location
    libya
    MS-Off Ver
    2010
    Posts
    734

    Re: hide rows based on two columns

    thanks sintek this is better

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

    Re: hide rows based on two columns

    Glad I could assist...tx for unexpected rep +

+ 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 Rows based on two columns
    By graham312 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 09-07-2016, 07:22 AM
  2. Replies: 1
    Last Post: 05-23-2016, 01:53 PM
  3. Hide Rows/Hide Columns Based on Value in Cell
    By brickwall823 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-24-2015, 02:42 PM
  4. [SOLVED] Hide rows and columns based on a combobox value
    By yasirmusa in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-23-2012, 04:52 PM
  5. how to hide rows based on the value of two columns
    By salventuro in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 04-19-2009, 07:29 PM
  6. Hide Blank Rows based on 2 columns
    By yzer19 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-06-2008, 11:23 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