+ Reply to Thread
Results 1 to 10 of 10

Hide/Unhide row based on given criteria w. no Trigger butn

  1. #1
    Registered User
    Join Date
    02-08-2013
    Location
    Australia
    MS-Off Ver
    MS 2007 / MS 2011
    Posts
    35

    Exclamation Hide/Unhide row based on given criteria w. no Trigger butn

    Good day all!

    I am after a macro that can hide or unhide a row if cell A# contains a trigger variable.

    EXAMPLE:

    Row 1: if A1=1 then HIDDEN row

    Note the following:
    - A1 contains a formula, which achieves the number 1.
    - If A1 were to change back to say 0, row needs to be UNHIDDEN.
    - I'd prefer it if it would automatically refresh (and no need for the macro to search through all 21957129837 rows, just a range, say 1:99999.

    Also this should be done automatically i.e. no trigger buttons but the formula within the trigger cell.

    Hope this is enough information.

    Thanks guys! Your help is much appreciated
    Dan
    Last edited by m1zz13; 02-18-2013 at 05:01 AM. Reason: Added info

  2. #2
    Registered User
    Join Date
    02-08-2013
    Location
    Australia
    MS-Off Ver
    MS 2007 / MS 2011
    Posts
    35

    Re: Hide/Unhide row based on given criteria w. no Trigger butn

    If you require an example spreadsheet please let me know

    I found this code which does the trick BUT it hides or unhides a certain range. I want it to hide / unhide a row subject to the first cell value.

    Please Login or Register  to view this content.
    Last edited by m1zz13; 02-18-2013 at 05:32 AM.

  3. #3
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Hide/Unhide row based on given criteria w. no Trigger butn

    Do right click on sheet tab and select view code and copy and paste the below code in Code Window

    Please Login or Register  to view this content.


    If your problem is solved, then please mark the thread as SOLVED>>Above your first post>>Thread Tools>>
    Mark your thread as Solved


    If the suggestion helps you, then Click *below to Add Reputation

  4. #4
    Registered User
    Join Date
    02-08-2013
    Location
    Australia
    MS-Off Ver
    MS 2007 / MS 2011
    Posts
    35

    Re: Hide/Unhide row based on given criteria w. no Trigger butn

    Thanks Sixsense, for some reason it's not running for me

  5. #5
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Hide/Unhide row based on given criteria w. no Trigger butn

    It's working fine for me check whether the calculation of the workbook is set to automatic

  6. #6
    Registered User
    Join Date
    02-08-2013
    Location
    Australia
    MS-Off Ver
    MS 2007 / MS 2011
    Posts
    35

    Re: Hide/Unhide row based on given criteria w. no Trigger butn

    Hi Sixsense,

    Might it be because I am using Excel 2011 (mac osx)? As soon as I enter the code, it stops me from adding more than 1 character per cell and can't use the Enter key to go to next cell.

  7. #7
    Valued Forum Contributor
    Join Date
    02-09-2012
    Location
    Mauritius
    MS-Off Ver
    Excel 2007
    Posts
    1,055

    Re: Hide/Unhide row based on given criteria w. no Trigger butn

    Hi

    Try this one:

    hideunhide.xlsm
    Click *, if my suggestion helps you. Have a good day!!

  8. #8
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Hide/Unhide row based on given criteria w. no Trigger butn

    Sorry I don't know anything about Mac

  9. #9
    Registered User
    Join Date
    02-08-2013
    Location
    Australia
    MS-Off Ver
    MS 2007 / MS 2011
    Posts
    35

    Re: Hide/Unhide row based on given criteria w. no Trigger butn

    Quote Originally Posted by jraj1106 View Post
    Hi

    Try this one:

    Attachment 214893
    Thanks jraj, it's not doing anything for me for some reason

    Quote Originally Posted by :) Sixthsense :) View Post
    Sorry I don't know anything about Mac
    Thanks Sixsense, what about Autofiltering? I have seen on another website an autofilter that makes rows disappear subject to cell value in A# column, BUT it doesn't reappear and its very slow because it ranges through the whole column.

    Sorry for the hassle I just don't know how to manipulate the code

  10. #10
    Forum Guru :) Sixthsense :)'s Avatar
    Join Date
    01-01-2012
    Location
    India>Tamilnadu>Chennai
    MS-Off Ver
    2003 To 2010
    Posts
    12,770

    Re: Hide/Unhide row based on given criteria w. no Trigger butn

    Try this....

    Do right click on sheet tab and select view code and copy and paste the below code in Code Window

    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