+ Reply to Thread
Results 1 to 10 of 10

Option button to hide rows

  1. #1
    Registered User
    Join Date
    10-26-2009
    Location
    Zurich
    MS-Off Ver
    Excel 2007
    Posts
    4

    Option button to hide rows

    I need a little help here as I am trying something new, and am not sure how to proceed.
    I am trying to change from 2 columns to 3 columns where there are a few variables. This is the original:
    Please Login or Register  to view this content.
    This works fine as it simply hides the rows that have no value.
    I need to make this with columns 4 5 and 6, and all 3 are variable, so that if I hide column 4, 5 and 6 are visible, and only the empty cells from these 2 columns will be hidden and i want to hide and row that has no value, but if one or the other has a value (x) then it must remain visible.
    Does anyone know a macro that I can use for this?
    Kinda stuck and have no real idea how to make it work.

    Thanks
    Last edited by royUK; 10-26-2009 at 04:45 AM.

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Option button to hide rows

    Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here

    I will add them this time only, uture posts may be locked if you don't follow the Rules
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Option button to hide rows

    To best describe or illustrate your problem you would be better off attaching a dummy workbook, the workbook should contain the same structure and some dummy data of the same type as the type you have in your real workbook - so, if a cell contains numbers & letters in this format abc-123 then that should be reflected in the dummy workbook.

    If needed supply a before and after sheet in the workbook so the person helping you can see what you are trying to achieve.

    Doing this will ensure you get the result you need!

  4. #4
    Registered User
    Join Date
    10-26-2009
    Location
    Zurich
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Option button to hide rows

    This is basically what I have now, and if there is an x in any of the boxes the row needs to stay. If I hide a column then the row can be hidden if the 3 remaining columns are empty, even if the hiddin column has an x.
    is this possible??
    Attached Files Attached Files

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Option button to hide rows

    Your table layout will cuse problems. I suggest you remove the Merged Cells, then for AutoFilter to work correctly the data should have a header row above the data. It's not clear to Excel which Row is the header row.

    Is this what you need?

    Please Login or Register  to view this content.
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    10-26-2009
    Location
    Zurich
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Option button to hide rows

    Hi RoyUK,

    That is in the right direction as to what i need, but I have about 60 different parts on the car which need to be changed sometimes. If any of the 3 columns have a x in the cell then the row needs to stay. Only if the 3 cells are empty can I hide the row. So, if I hide Toni, then all parts for Tim and Arne need to stay. Does this make sense?
    I seem to think autofilter is not the right way to go.
    Cheers

  7. #7
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Option button to hide rows

    The code that I posted will only filter each individual. Are you clearing the Filter before continuing?

  8. #8
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Option button to hide rows

    Do you mean that all 3 columns need to be empty for each row?

  9. #9
    Registered User
    Join Date
    10-26-2009
    Location
    Zurich
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Option button to hide rows

    Basically if no columns are hidden, then all 3 cells must be empty for the row to be hidden. If you hide one of the columns then only the 2 remaining columns need have empty cells for the row to be hidden. And if 2 columns are hidden then the autofilter works fine as it is the only column left.

  10. #10
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Option button to hide rows

    Try this
    Please Login or Register  to view this content.

+ 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