+ Reply to Thread
Results 1 to 4 of 4

Unhide rows based on cell value

  1. #1
    Registered User
    Join Date
    10-20-2019
    Location
    Bulgaria
    MS-Off Ver
    Microsoft office 365 pro plus
    Posts
    13

    Unhide rows based on cell value

    Hi guys,

    I want to build a macro that will unhide rows (33:72) based on the value in one of two cells - B20 or B21 (it has to be mentioned that the cells in question contain formulas, so the value in them depends on other cells. If the value in cell B20 is > 0 the value in cell B21 is 0 and vice versa. So it is important that the macro is automatically triggered by a change in those cells).
    The possible values in cell B20 are 1 to 25 and the possible values in cell B21 are 1,2,5,15 or 25.

    So what I want the macro to do is - when the value in either B20 or B21 is a certain number to unhide that amount of rows. For example it is "1" - unhide row 33. If it is "2" - unhide rows 33 and 34.

    Thank you very much! Your help is highly appreciated!

    Best regards,
    Alex

  2. #2
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,820

    Re: Unhide rows based on cell value

    Copy and paste this macro into the worksheet code module. Do the following: right click the tab name for your sheet and click 'View Code'. Paste the macro into the empty code window that opens up. Close the code window to return to your sheet.

    Please Login or Register  to view this content.
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  3. #3
    Registered User
    Join Date
    10-20-2019
    Location
    Bulgaria
    MS-Off Ver
    Microsoft office 365 pro plus
    Posts
    13

    Re: Unhide rows based on cell value

    Thank you for your answer. The problem is that I already have the code below and I get an error and the workbook crashes.

    Please Login or Register  to view this content.

  4. #4
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,820

    Re: Unhide rows based on cell value

    Can you attach a copy of your file including all your current macros?

+ 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] Unhide rows based on a cell value
    By jwillis07 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-13-2019, 09:32 AM
  2. [SOLVED] VBA Help to UNHIDE rows in a sheet based on a cell value
    By hchahal in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-14-2017, 01:50 PM
  3. [SOLVED] Unhide rows based on cell criteria
    By kosherboy in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 11-23-2015, 02:11 PM
  4. Need Toggle Button to hide/unhide rows based on cell value in non concurrent rows
    By The Phoenix in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 07-13-2015, 10:49 AM
  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. Unhide rows based on cell value
    By Sky188 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-09-2012, 06:03 PM
  7. Hide/Unhide Rows Based On Cell Value
    By ZooTV92 in forum Excel General
    Replies: 5
    Last Post: 09-05-2011, 07:51 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