Hi all,
Thank you for reading this thread.
I am trying to use the commands to show or hide certain rows based on one column's value.
The case here is:
1. I have 10 people on a name list.
2. 10 people have been assigned to 3 groups.
3. Each person is unique and belongs to only one group.
4. Each row has been randomly arranged, followed no A to Z, smallest to largest sequences. For example, Row 2, which is the very next row after the header, will have a name of Michael in Cell A2 and a group number 1 in Cell B2. Then for Row 3, it will have a name of Chris in Cell A3 and a group number 3 in Cell B3.
I want to use below 2 methods to display the results I wanted on this sheet by either using a drop down list, or a Macro button:
Using a drop down list
1. Set up a drop down list with 3 values (group numbers), which of course they will be number 1, 2 and 3, and then with a value to be "ALL".
2. After selected the value to be 1 in the drop down list, only the rows have people belonging to group number 1 will become visible. All other rows, except the header, will disappear/ be hidden.
3. Then, after selected the value to be ALL in the drop down list, all rows will then show again, because I want to see every single row again.
Using a Macro button
1. Set up a Macro button to be named as Group Number.
2. On the right side of this button, on the example sheet I have attached, leave a blank cell, which is F15, for the purpose of entering 4 values: 1, 2, 3, ALL.
3. Then, I want to use this Macro button to have the same result as how I wanted by using the drop down list.
4. For example, I have now entered "2" in F15. Then after I hit the Macro button "Group", it will automatically show every row that has a number 2 value in the B column, and then automatically hide all other rows.
5. The reason why only rows that have a number 2 value need to show, is because I want to see who are the names/ people belong to group number 2, under B column.
I have tried multiple codes but it seems not working at all.
Would highly appreciate if anybody could look into this for me and again, thank you so much!!!
Bookmarks