Golfpro1286
New Member
- Joined
- Aug 22, 2018
- Messages
- 30
Hello, I have looked around and could not find any VBA that would work for what I am trying to do, which seemed like it should be simpler than it is turning out to be. I want to automatically hide and unhide some rows based on the following:
I have a summary sheet (in "Sheet 1") that summarizes the number of loans an officer makes within a given system. I want to hide/un-hide any rows with "0". Example:
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Row[/TD]
[TD]Name[/TD]
[TD]Count[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Adam[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Corey[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Trevor[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]Jim[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]Randy[/TD]
[TD]0
[/TD]
[/TR]
</tbody>[/TABLE]
Here is how the count is calculated:
The loan data is entered into a table on a separate sheet ("Sheet 2") as follows:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Officer[/TD]
[TD]Loan #[/TD]
[TD]System[/TD]
[/TR]
[TR]
[TD]Adam[/TD]
[TD]1234[/TD]
[TD]CL[/TD]
[/TR]
[TR]
[TD]Adam[/TD]
[TD]5678[/TD]
[TD]CL[/TD]
[/TR]
[TR]
[TD]Corey[/TD]
[TD]91011[/TD]
[TD]IL[/TD]
[/TR]
[TR]
[TD]Trevor[/TD]
[TD]8765[/TD]
[TD]ML[/TD]
[/TR]
[TR]
[TD]Jim[/TD]
[TD]5843[/TD]
[TD]CL[/TD]
[/TR]
[TR]
[TD]Jim[/TD]
[TD]4128[/TD]
[TD]IL[/TD]
[/TR]
[TR]
[TD]Randy[/TD]
[TD]6634[/TD]
[TD]ML[/TD]
[/TR]
</tbody>[/TABLE]
In "Sheet 1" I have a combo box to change the system between "CL" "IL" and "ML"
The count column is calculated from a COUNTIFS formula that will use data from table on "Sheet 2" to count number of loans for the system selected in the combo box.
My expected results here would be as follows:
If CL is selected in the combo box rows 2,3,5 would auto-hide because the value would be 0 and rows 1,4 would auto un-hide becuase their value would be greater than 0.
If IL is selected in the combo box rows 1,3,5 would auto-hide because the value would be 0 and rows 2,4 would auto un-hide becuase their value would be greater than 0.
If ML is selected in the combo box rows 1,2,4 would auto-hide because the value would be 0 and rows 3,5 would auto un-hide becuase their value would be greater than 0.
Thanks for any help!
I have a summary sheet (in "Sheet 1") that summarizes the number of loans an officer makes within a given system. I want to hide/un-hide any rows with "0". Example:
[TABLE="class: grid, width: 500"]
<tbody>[TR]
[TD]Row[/TD]
[TD]Name[/TD]
[TD]Count[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Adam[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]Corey[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]Trevor[/TD]
[TD]1[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]Jim[/TD]
[TD]0[/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]Randy[/TD]
[TD]0
[/TD]
[/TR]
</tbody>[/TABLE]
Here is how the count is calculated:
The loan data is entered into a table on a separate sheet ("Sheet 2") as follows:
[TABLE="width: 500"]
<tbody>[TR]
[TD]Officer[/TD]
[TD]Loan #[/TD]
[TD]System[/TD]
[/TR]
[TR]
[TD]Adam[/TD]
[TD]1234[/TD]
[TD]CL[/TD]
[/TR]
[TR]
[TD]Adam[/TD]
[TD]5678[/TD]
[TD]CL[/TD]
[/TR]
[TR]
[TD]Corey[/TD]
[TD]91011[/TD]
[TD]IL[/TD]
[/TR]
[TR]
[TD]Trevor[/TD]
[TD]8765[/TD]
[TD]ML[/TD]
[/TR]
[TR]
[TD]Jim[/TD]
[TD]5843[/TD]
[TD]CL[/TD]
[/TR]
[TR]
[TD]Jim[/TD]
[TD]4128[/TD]
[TD]IL[/TD]
[/TR]
[TR]
[TD]Randy[/TD]
[TD]6634[/TD]
[TD]ML[/TD]
[/TR]
</tbody>[/TABLE]
In "Sheet 1" I have a combo box to change the system between "CL" "IL" and "ML"
The count column is calculated from a COUNTIFS formula that will use data from table on "Sheet 2" to count number of loans for the system selected in the combo box.
My expected results here would be as follows:
If CL is selected in the combo box rows 2,3,5 would auto-hide because the value would be 0 and rows 1,4 would auto un-hide becuase their value would be greater than 0.
If IL is selected in the combo box rows 1,3,5 would auto-hide because the value would be 0 and rows 2,4 would auto un-hide becuase their value would be greater than 0.
If ML is selected in the combo box rows 1,2,4 would auto-hide because the value would be 0 and rows 3,5 would auto un-hide becuase their value would be greater than 0.
Thanks for any help!