+ Reply to Thread
Results 1 to 7 of 7

Show and hide rows on command

  1. #1
    Registered User
    Join Date
    02-07-2011
    Location
    Brussels, Belgium
    MS-Off Ver
    Excel 2007
    Posts
    4

    Show and hide rows on command

    Dear all,

    For a task-list I made in excel I use a dropdown where users can choose their name, and see their personal tasks verry easy. (As it sometimes happend that on one job Member 1 is a junior, and on the other job Member 1 is a senior, I didn't want to work with the filter-system)

    I manage this true following code:

    Please Login or Register  to view this content.

    As I use my name 'Member 1', it displays exactly what I want; it hides all other lines.
    But if I want to go back, and choose for another member's name, the script doesn't work.

    Also when I want to show everyone's workload, I can't go back to this view...

    The fault is probably in the 'Cells(RowCnt, 1)' code, but I don't know how I can solve this.
    I managed to do this when I change at the beginning "EndRow = Range("B65536").End(xlUp).Row" into "EndRow = 1000", but I don't want that Excel is going to hide rows where there are no tasks in it (no content in column B).

    Can anyone please help me?

    Thank you all in advance.


    Edit: Is there perhaps a more simple method as my code above? And this because I have about 30 - 40 members... Thanks!
    Last edited by NMarien; 02-07-2011 at 08:27 AM. Reason: message incomplete - additional question

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Show and hide rows on command

    To simplify - you should create a further column of data that concatenates Col F with Columns AM:AO

    With this column you can then just apply a standard Auto Filter technique (via VBA) based on the concatenation - and trigger it when the DV selection is altered.

    Obviously you can adapt the Select Case as necessary.
    Attached Files Attached Files

  3. #3
    Registered User
    Join Date
    02-07-2011
    Location
    Brussels, Belgium
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Show and hide rows on command

    Thanks!

    How exactly does it works when I want to use names instead of numbers?
    Let's say:

    Siebert Marien
    Piet Melis
    Senne Pieters?

    Thank you verry much in advance.

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Show and hide rows on command

    Perhaps you could post some examples that relate to the above ?

  5. #5
    Registered User
    Join Date
    02-07-2011
    Location
    Brussels, Belgium
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Show and hide rows on command

    Dear

    please find attached of what I exactly mean...

    This is just a simple overview, but the purpose is still the same. I've I would select my name (N Marien) I'll only see the rows for which I'm responsible.
    All others rows should be hided than (untill the last row where there's data).

    If I would select 'All members', all rows should be visible again.

    I hope this is clear, and that you will learn me something. (it has been too long since I have studied some VBA, and I'm starting to need it more and more in my day-time job).

    Thanks in advance,



    Niels
    Attached Files Attached Files

  6. #6
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: Show and hide rows on command

    see attached - this is just a slight variation from the approach outlined/demonstrated previously
    Attached Files Attached Files

  7. #7
    Registered User
    Join Date
    02-07-2011
    Location
    Brussels, Belgium
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: Show and hide rows on command

    Thanks! I got it working!!

+ 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