+ Reply to Thread
Results 1 to 5 of 5

How to create a view option (or hide/unhide preselected cells) (Repost from Misc)

  1. #1
    Registered User
    Join Date
    06-07-2006
    Location
    Montreal
    Posts
    73

    Question How to create a view option (or hide/unhide preselected cells) (Repost from Misc)

    I have the following problem: I need to set a worksheet so the user can choose to view/print it with or without the cells containing exhaustive explanations. (Those cells are NOT in a single bundle...)

    Is there a way, (say, with a button or another macro), that I could set this worksheet to hide or unhide preselected rows so the user can switch from one view to another in a single simple operation?

    (Any suggestion is welcome: I need all available options.)

    THANKS!

    For those who wants to know the purpose: it is a compliance matrix (checklist-like) with design requirements. The cells that need to be set are the ones containing secondary information regarding each of the requirements. (The "simple" view should allow to shorten the list considerably, without loosing the information.)

  2. #2
    Jim Jackson
    Guest

    RE: How to create a view option (or hide/unhide preselected cells) (Re

    You could try the "Autofilter" approach.

    When the button for "Incomplete" could trigger the following code:

    Sheets("Sheetname").Select
    Activesheet.Columns("D").select ' Assuming Column D holds the terms
    "Complete" and "Incomplete"

    Selection.AutoFilter Field:=1, Criteria1:="=Incomplete"

    Jim

    "Turquoise_dax" wrote:

    >
    > I have the following problem: I need to set a worksheet so the user can
    > choose to view/print it with or without the cells containing exhaustive
    > explanations. (Those cells are NOT in a single bundle...)
    >
    > Is there a way, (say, with a button or another macro), that I could set
    > this worksheet to hide or unhide preselected rows so the user can switch
    > from one view to another in a single simple operation?
    >
    > (Any suggestion is welcome: I need all available options.)
    >
    > THANKS!
    >
    > For those who wants to know the purpose: it is a compliance matrix
    > (checklist-like) with design requirements. The cells that need to be
    > set are the ones containing secondary information regarding each of the
    > requirements. (The "simple" view should allow to shorten the list
    > considerably, without loosing the information.)
    >
    >
    > --
    > Turquoise_dax
    > ------------------------------------------------------------------------
    > Turquoise_dax's Profile: http://www.excelforum.com/member.php...o&userid=35185
    > View this thread: http://www.excelforum.com/showthread...hreadid=552401
    >
    >


  3. #3
    Registered User
    Join Date
    06-07-2006
    Location
    Montreal
    Posts
    73

    Unhappy I am surely missing something...

    I tried it, (adjusting column and criteria, of course!), and when I click the button, it hides all rows (2-12) while only the 8 and 11 contained the criteria.

    On the other hand, I am a newbie at trying to programm buttons, so maybe I do something wrong right from the start...

    (I used the tool to create the button, I assigned a macro, and I went in visual basic, simply cutting/pasting your code, getting rid of the comments and adjusting column letter and criteria.)

  4. #4
    topper09er
    Guest

    Re: How to create a view option (or hide/unhide preselected cells) (Repost from Misc)

    I am not very good at macros or more advanced things in excel, but what
    I would do is just make a checkbox that asks if the user wants the long
    explanations on/off and link it to say A1. Then in the cells with the
    long explanations put the code: =if(A1=true,"long
    exanations...","shorter explanations..."), or go into conditional
    formatting and type under formula =A1=true then change the font color
    to white so it does not appear.

    just some ideas of what i might try

    Turquoise_dax wrote:
    > I have the following problem: I need to set a worksheet so the user can
    > choose to view/print it with or without the cells containing exhaustive
    > explanations. (Those cells are NOT in a single bundle...)
    >
    > Is there a way, (say, with a button or another macro), that I could set
    > this worksheet to hide or unhide preselected rows so the user can switch
    > from one view to another in a single simple operation?
    >
    > (Any suggestion is welcome: I need all available options.)
    >
    > THANKS!
    >
    > For those who wants to know the purpose: it is a compliance matrix
    > (checklist-like) with design requirements. The cells that need to be
    > set are the ones containing secondary information regarding each of the
    > requirements. (The "simple" view should allow to shorten the list
    > considerably, without loosing the information.)
    >
    >
    > --
    > Turquoise_dax
    > ------------------------------------------------------------------------
    > Turquoise_dax's Profile: http://www.excelforum.com/member.php...o&userid=35185
    > View this thread: http://www.excelforum.com/showthread...hreadid=552401



  5. #5
    Jim Jackson
    Guest

    RE: How to create a view option (or hide/unhide preselected cells)

    I should have asked if your other columns were set for Autofilter. In the
    example I gave, if columns A through D are set for Autofilter then use
    Field:=4 and it should work.

    Jim

    "Jim Jackson" wrote:

    > You could try the "Autofilter" approach.
    >
    > When the button for "Incomplete" could trigger the following code:
    >
    > Sheets("Sheetname").Select
    > Activesheet.Columns("D").select ' Assuming Column D holds the terms
    > "Complete" and "Incomplete"
    >
    > Selection.AutoFilter Field:=1, Criteria1:="=Incomplete"
    >
    > Jim
    >
    > "Turquoise_dax" wrote:
    >
    > >
    > > I have the following problem: I need to set a worksheet so the user can
    > > choose to view/print it with or without the cells containing exhaustive
    > > explanations. (Those cells are NOT in a single bundle...)
    > >
    > > Is there a way, (say, with a button or another macro), that I could set
    > > this worksheet to hide or unhide preselected rows so the user can switch
    > > from one view to another in a single simple operation?
    > >
    > > (Any suggestion is welcome: I need all available options.)
    > >
    > > THANKS!
    > >
    > > For those who wants to know the purpose: it is a compliance matrix
    > > (checklist-like) with design requirements. The cells that need to be
    > > set are the ones containing secondary information regarding each of the
    > > requirements. (The "simple" view should allow to shorten the list
    > > considerably, without loosing the information.)
    > >
    > >
    > > --
    > > Turquoise_dax
    > > ------------------------------------------------------------------------
    > > Turquoise_dax's Profile: http://www.excelforum.com/member.php...o&userid=35185
    > > View this thread: http://www.excelforum.com/showthread...hreadid=552401
    > >
    > >


+ 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