+ Reply to Thread
Results 1 to 11 of 11

Hiding Rows With A Cell Containing "0"

  1. #1
    Registered User
    Join Date
    05-05-2006
    Location
    Kent, England
    Posts
    37

    Red face Hiding Rows With A Cell Containing "0"

    Hi All

    Can someone please give me a bit of code so that when I open a sheet (which takes data from another sheet) it hides rows which contain a zero in a certain cell?

    Thanks in advance
    ExcelBob

  2. #2
    Valued Forum Contributor
    Join Date
    06-16-2006
    Location
    Sydney, Australia
    MS-Off Ver
    2013 64bit
    Posts
    1,394
    It depends. If all the cells are in the same column, just use an auto filter that filters out zeros. If the zeros can be anyware, you will need a macro. But then again I doubt they can be anyware. Can you give some more detail about where the zeros can appear.

    Matt

  3. #3
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070
    Hi,

    To be adapted to your needs ...

    Please Login or Register  to view this content.
    HTH
    Cheers
    Carim
    Last edited by Simon Lloyd; 04-23-2008 at 02:09 PM.

  4. #4
    Registered User
    Join Date
    05-05-2006
    Location
    Kent, England
    Posts
    37
    Thanks for help. Still can't get it to work so will explain some more.

    Basically I have data in cells A15 to F37

    Where there is a "0" in cells F15: F37 I want the entire row to hide. I would like this to be automated when the workbook is opened...

    Thanks again.... :D

  5. #5
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,525
    of course there is code for that but there is also autofilter, select the range you want to filter and goto data autofilter..
    but here's some code to hide rows, it searches rangeK1:K25 and hides whatever row is equal to zero

    Please Login or Register  to view this content.

  6. #6
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070
    Hi,

    Insert code in event macro

    Please Login or Register  to view this content.

    HTH
    Carim
    Last edited by Simon Lloyd; 04-23-2008 at 02:10 PM.

  7. #7
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070
    Oops

    make sure to change starting point to
    Please Login or Register  to view this content.
    Carim
    Last edited by Simon Lloyd; 04-23-2008 at 02:10 PM.

  8. #8
    Forum Contributor
    Join Date
    08-10-2006
    Posts
    723
    hi carim

    this code is helpful to me

    but when i run it it does not stop
    any ideas please?

    steve

  9. #9
    Forum Expert Carim's Avatar
    Join Date
    04-07-2006
    Posts
    4,070
    Guess,

    I am typing too quickly ...
    .Value has nothing to do in this code ...

    Please Login or Register  to view this content.
    HTH
    Carim
    Last edited by Simon Lloyd; 04-23-2008 at 02:10 PM.

  10. #10
    Forum Contributor
    Join Date
    08-10-2006
    Posts
    723
    hi carim

    still a problem with code if the last row has 0 in it the last row does not see it

    any ideas please

    steve

  11. #11
    Registered User
    Join Date
    04-08-2008
    Posts
    7

    Slightly adaption of Davesexcel code

    Thanks for the help. I've changed the code a little for my specific needs and thought it may be of use for someone else.


    Please Login or Register  to view this content.
    Thanks again Dave!

    Bunches

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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