+ Reply to Thread
Results 1 to 4 of 4

How to hide rows based on value in a different cell

  1. #1
    Registered User
    Join Date
    10-31-2011
    Location
    Kent, England
    MS-Off Ver
    Excel 2010
    Posts
    43

    How to hide rows based on value in a different cell

    Good afternoon

    I am trying to write a VBA code to make things easier for staff using a QC run sheet (hopefully attached) in a printing company where I work.

    Firstly, based on value's in J16 - J24, I want it to hide tabs, which I believe I have got to work.

    Secondly, based on the values in the same cells as above, I then want it to hide rows in the "Front Sheet V2" so for example, if J18 = "No", then rows 43 - 56 would be hidden (corresponding section on the same worksheet).
    This only works if all (J16 - J24) and clicked as "Yes", otherwise it repeats columns which I can not understand).

    Thirdly, based on the value (1 - 6) in cell J26, I then want it to hide rows under each sub heading, so again for example, if J26 = 3 and J16 = "Yes" then Rows 37 - 41 would be hidden. Again this only works if J16 - J24 are all checked as yes, otherwise it duplicates rows.

    Finally, based on the value in J26, I then want to hide rows in the corresponding tabs, so using the example above, rows "28 - 33" would be hidden on the "DIGITAL V2" tab.

    I have had a good go, but I have no experience in VBA although willing to learn hence I tried to do it myself (with a little help from google)
    Attached Files Attached Files

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: How to hide rows based on value in a different cell

    All your end testing is based only upon < 2 - 6 That means that a 6 will never trigger and a 1 will always trigger.

    I think that might be your problem
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,653

    Re: How to hide rows based on value in a different cell

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  4. #4
    Registered User
    Join Date
    10-31-2011
    Location
    Kent, England
    MS-Off Ver
    Excel 2010
    Posts
    43

    Re: How to hide rows based on value in a different cell

    Thank you both, I told you I was a newbie at VBA... rookie mistake. AlphaFrog your script works perfectly, thank you so so much!

+ 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. Hide Rows based on cell value
    By bilalo94 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-31-2017, 12:33 PM
  2. 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
  3. 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
  4. VBA to hide rows based on cell value
    By Jace15 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-18-2014, 04:28 AM
  5. Hide Rows based on cell value
    By mjg060468 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-07-2014, 12:28 PM
  6. [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
  7. Hide rows based on a value in cell A1
    By Torpedojager in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-20-2008, 08:14 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