+ Reply to Thread
Results 1 to 8 of 8

Hide rows based on value "0" in multiple columns

  1. #1
    Registered User
    Join Date
    09-18-2012
    Location
    South Africa
    MS-Off Ver
    Excel2007
    Posts
    3

    Hide rows based on value "0" in multiple columns

    I am new to programming and macro's.

    Can anyone help me with the following problem.

    I have on sheet three multiple items listed from row 5 to 6886.

    Column AO to AZ have the quantities on hand for specific dates.

    How do I hide a row if AO to AZ all contain the value "0"?

  2. #2
    Forum Contributor
    Join Date
    08-20-2012
    Location
    Walsall,England
    MS-Off Ver
    Excel 2007
    Posts
    125

    Re: Hide rows based on value "0" in multiple columns

    Hi,

    Please Login or Register  to view this content.

    How is that?


    Moderator Edit:

    Welcome to the forum, anteagles20.

    Please notice that code tags have been added to your post. The forum rules require them so please keep that in mind and add them yourself whenever showing code in any of your future posts. To see instructions for applying them, click on the Forum Rules button at the top of the page and read Rule #3.
    Thanks.
    Last edited by Cutter; 09-18-2012 at 01:32 PM. Reason: Added code tags

  3. #3
    Registered User
    Join Date
    09-18-2012
    Location
    South Africa
    MS-Off Ver
    Excel2007
    Posts
    3

    Re: Hide rows based on value "0" in multiple columns

    I tried running the script, but it doesn't seem to do anything. I think the logic is correct, but I am to inexperienced to get it sorted myself. I appreciate all the help, maybe I just need to change something, any ideas?

  4. #4
    Forum Contributor
    Join Date
    08-20-2012
    Location
    Walsall,England
    MS-Off Ver
    Excel 2007
    Posts
    125

    Re: Hide rows based on value "0" in multiple columns

    Have you put the code in a module?

    Should have mentioned this but you may need to change the sheet references. In the VB editor you should have a project explorer window on the left. This contains the various objects where you can put your code, including sheet objects. In the code above I wrote Sheet3. When you look at the excel objects in the project explorer you will see each sheet has a program name (the first name) followed by a name in brackets (which is the name you see in the tab in the workbook). Sheet3 is a reference to the program name, so you may need to change this to the relevant sheet program name. I have bolded the sheet references in the original post.

    Does that make sense?

  5. #5
    Forum Contributor
    Join Date
    08-20-2012
    Location
    Walsall,England
    MS-Off Ver
    Excel 2007
    Posts
    125

    Re: Hide rows based on value "0" in multiple columns

    Just another thought, do the columns contain any text string and can numbers be negatives?

  6. #6
    Registered User
    Join Date
    09-18-2012
    Location
    South Africa
    MS-Off Ver
    Excel2007
    Posts
    3

    Re: Hide rows based on value "0" in multiple columns

    Thanks for that, it makes perfect sense. Rookie mistake on my part. Everything is sorted and working 100%.

    Thanks for all your trouble and advise. It is really appreciated.

  7. #7
    Forum Contributor
    Join Date
    08-20-2012
    Location
    Walsall,England
    MS-Off Ver
    Excel 2007
    Posts
    125

    Re: Hide rows based on value "0" in multiple columns

    No problem

  8. #8
    Forum Guru Winon's Avatar
    Join Date
    02-20-2007
    Location
    East Rand, R.S.A.
    MS-Off Ver
    2010
    Posts
    6,113

    Re: Hide rows based on value "0" in multiple columns

    Hallo willieh,

    Attached is a sample WorkBook of another approach I took.

    @ anteagles20,

    I cannot get your Code to work, and yet I am also using Excel 2007.

    Am I missing something else here?.
    Attached Files Attached Files
    Please consider:

    Be polite. Thank those who have helped you. Then Click on the star icon in the lower left part of the contributor's post and add Reputation. Cleaning up when you're done. If you are satisfied with the help you have received, then Please do Mark your thread [SOLVED] .

+ 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