+ Reply to Thread
Results 1 to 6 of 6

Unhide/Hide rows in range based on value (improve code)

  1. #1
    Registered User
    Join Date
    10-06-2015
    Location
    London
    MS-Off Ver
    2010
    Posts
    20

    Question Unhide/Hide rows in range based on value (improve code)

    Hi,

    I have implemented a macro button which hides/unhides cells within a range based on their value. It works correctly but the only way I could figure out to do it was via an autofilter and it seems a bit slow.

    I used "<>" because I can alternate between hiding blank cells and hiding cells equal to 0.

    Please Login or Register  to view this content.
    Any help to create a quicker solution would be much appreciated.

    Thanks,
    M

  2. #2
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: Unhide/Hide rows in range based on value (improve code)

    Try this code
    Please Login or Register  to view this content.
    < ----- Please click the little star * next to add reputation if my post helps you
    Visit Forum : From Here

  3. #3
    Registered User
    Join Date
    10-06-2015
    Location
    London
    MS-Off Ver
    2010
    Posts
    20

    Re: Unhide/Hide rows in range based on value (improve code)

    Thanks for your response YasserKhalil.

    This didn't seem to solve my problem. I'm looking to move away from using AutoFilter and just hide the relevant rows if that would speed it up.

    Additionally, I've realised that I have two sections attempting to AutoFilter on the same page so my formula won't work.
    Last edited by MP1286; 02-03-2017 at 10:33 AM.

  4. #4
    Registered User
    Join Date
    10-06-2015
    Location
    London
    MS-Off Ver
    2010
    Posts
    20

    Re: Unhide/Hide rows in range based on value (improve code)

    Managed to solve this one via the following:

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    10-06-2015
    Location
    London
    MS-Off Ver
    2010
    Posts
    20

    Re: Unhide/Hide rows in range based on value (improve code)

    Double post.
    Last edited by MP1286; 02-03-2017 at 11:06 AM.

  6. #6
    Forum Expert
    Join Date
    04-23-2009
    Location
    Matrouh, Egypt
    MS-Off Ver
    Excel 2013
    Posts
    6,882

    Re: Unhide/Hide rows in range based on value (improve code)

    Glad you can figure it out yourself
    But using loops is slower than filter method I wonder ..

+ 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] Formula or code to hide or unhide rows based on value in a cell
    By pongmeister in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 08-26-2015, 10:34 AM
  2. [SOLVED] Need to improve some code to hide and unhide certain columns
    By davidx in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-01-2015, 10:30 AM
  3. Vb code to hide/unhide rows based on entries on another sheet
    By tcrjmom in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-24-2015, 01:15 PM
  4. Need code to hide and unhide a row based on if other rows are hidden or unhidden
    By aradov in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 05-20-2014, 02:06 PM
  5. [SOLVED] First unhide all rows - then hide rows based on specific cell value for a range of cells
    By robbiekh in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-22-2013, 05:46 PM
  6. [SOLVED] How VB code can unhide/hide rows based on combobox selection?
    By jgomez in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 09-04-2012, 01:25 PM
  7. Replies: 2
    Last Post: 01-09-2012, 07:13 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