I am creating a UserForm with various functions using buttons but I want to "move on" from autofiltering or other methods I've used before.
I have a range "all_rows_summary" defined as "=Summary!$3:$204"
The range "gender" is defined as "=Summary!$F$3:$F$250" and has the value (which is the result of a formula shown in the cells) of "F" and "M" (which is the result of a VLookup formula shown in a cell).
I want to write a function for to "Show Boys" that hides all the rows with an "F" in the range "gender"...
I have looked on here and tried but can't get past initial errors... This is what I have so far:
I want to then reuse the code for other similar functions... Many thanks in advance
I have a range "all_rows_summary" defined as "=Summary!$3:$204"
The range "gender" is defined as "=Summary!$F$3:$F$250" and has the value (which is the result of a formula shown in the cells) of "F" and "M" (which is the result of a VLookup formula shown in a cell).
I want to write a function for to "Show Boys" that hides all the rows with an "F" in the range "gender"...
I have looked on here and tried but can't get past initial errors... This is what I have so far:
Code:
Private Sub CommandButton1_Click()
If Range("gender").Value = "F" Then
Range("all_rows_summary").EntireRow.Hidden = True
End If
End Sub
I want to then reuse the code for other similar functions... Many thanks in advance
Last edited: