Thanks Bob.
Can you or anyone else help me again please?
With the filtering of data what I realised is that I am unable to do a multiple selection. What I mean here is that, when I select AB as for the TG for example, it will filter and hide the rows that have other TGs. Now when I go to select M for the Gender it will then hide the one row with F in the gender and show me all the rows with M.
What I want to happen is when I filter to AB for the TG I want it to hide all the other TGs and then with the data showing, I want to be able to filter to M for the gender and it will filter according the data showing.
Step by step as to what I want.
This is an example of what is happening and after I will demonstrate what I want to see
Starting Point
| Row # |
NAME |
TG |
M/F |
ETHNICITY |
|
ENG KS2 |
MA KS2 |
SCI KS2 |
ENG TOTAL |
MA TOTAL |
SCI TOTAL |
| 1 |
Reen, Rig |
AB |
M |
WOWB |
|
5 |
5 |
6 |
42 |
63 |
55 |
| 2 |
Bling, Dot |
AD |
M |
WENG |
|
5 |
4 |
5 |
98 |
101 |
66 |
| 3 |
Cry, Ken |
AB |
F |
WENG |
|
6 |
3 |
4 |
55 |
75 |
57 |
| 4 |
Fish, Cal |
AC |
M |
BCRB |
|
4 |
3 |
3 |
42 |
92 |
30 |
Step one - Filter by TG to AB
| Row # |
NAME |
TG |
M/F |
ETHNICITY |
|
ENG KS2 |
MA KS2 |
SCI KS2 |
ENG TOTAL |
MA TOTAL |
SCI TOTAL |
| 1 |
Reen, Rig |
AB |
M |
WOWB |
|
5 |
5 |
6 |
42 |
63 |
55 |
| 3 |
Cry, Ken |
AB |
F |
WENG |
|
6 |
3 |
4 |
55 |
75 |
57 |
Step two - Filter by Gender to M
| Row # |
NAME |
TG |
M/F |
ETHNICITY |
|
ENG KS2 |
MA KS2 |
SCI KS2 |
ENG TOTAL |
MA TOTAL |
SCI TOTAL |
| 1 |
Reen, Rig |
AB |
M |
WOWB |
|
5 |
5 |
6 |
42 |
63 |
55 |
| 2 |
Bling, Dot |
AD |
M |
WENG |
|
5 |
4 |
5 |
98 |
101 |
66 |
| 4 |
Fish, Cal |
AC |
M |
BCRB |
|
4 |
3 |
3 |
42 |
92 |
30 |
However, this is rather what I want to see happening
Starting point
| Row # |
NAME |
TG |
M/F |
ETHNICITY |
|
ENG KS2 |
MA KS2 |
SCI KS2 |
ENG TOTAL |
MA TOTAL |
SCI TOTAL |
| 1 |
Reen, Rig |
AB |
M |
WOWB |
|
5 |
5 |
6 |
42 |
63 |
55 |
| 2 |
Bling, Dot |
AD |
M |
WENG |
|
5 |
4 |
5 |
98 |
101 |
66 |
| 3 |
Cry, Ken |
AB |
F |
WENG |
|
6 |
3 |
4 |
55 |
75 |
57 |
| 4 |
Fish, Cal |
AC |
M |
BCRB |
|
4 |
3 |
3 |
42 |
92 |
30 |
Step one - Filter by TG to AB
| Row # |
NAME |
TG |
M/F |
ETHNICITY |
|
ENG KS2 |
MA KS2 |
SCI KS2 |
ENG TOTAL |
MA TOTAL |
SCI TOTAL |
| 1 |
Reen, Rig |
AB |
M |
WOWB |
|
5 |
5 |
6 |
42 |
63 |
55 |
| 3 |
Cry, Ken |
AB |
F |
WENG |
|
6 |
3 |
4 |
55 |
75 |
57 |
Step two - Filter by Gender to M
| Row # |
NAME |
TG |
M/F |
ETHNICITY |
|
ENG KS2 |
MA KS2 |
SCI KS2 |
ENG TOTAL |
MA TOTAL |
SCI TOTAL |
| 1 |
Reen, Rig |
AB |
M |
WOWB |
|
5 |
5 |
6 |
42 |
63 |
55 |
So what I am asking is, is it possible to filter multiple times without the sheet resetting before it filters?
Hope this is clear...
Many Thanks in Advance
Below is the script I have written to run the filters. Or is there a way i can send the Work book on here?
'This will filter the table to the attribute in the TG drop down.
Sub TGFilter()
For i = 1 To 2
Worksheets(i).EnableCalculation = False
Next
Dim rRange, TheRow As Range
Set rRange = Worksheets("Test Sheet").Range("C4:C40")
Dim iRow As Integer
iRow = 1
While rRange(iRow, 1).Value <> ""
'rRange(iRow, 1).Select
If rRange(iRow, 1).Value = Worksheets("Test Sheet").Range("D1").Value Then
rRange(iRow, 1).EntireRow.Hidden = False
Else
rRange(iRow, 1).EntireRow.Hidden = True
End If
iRow = iRow + 1
Wend
For i = 1 To 2
Worksheets(i).EnableCalculation = True
Next
End Sub
'This will filter the table to the attribute in the Gender drop down.
Sub GenderFilter()
For i = 1 To 2
Worksheets(i).EnableCalculation = False
Next
Dim rRange, TheRow As Range
Set rRange = Worksheets("Test Sheet").Range("D4:D40")
Dim iRow As Integer
iRow = 1
While rRange(iRow, 1).Value <> ""
'rRange(iRow, 1).Select
If rRange(iRow, 1).Value = Worksheets("Test Sheet").Range("F1").Value Then
rRange(iRow, 1).EntireRow.Hidden = False
Else
rRange(iRow, 1).EntireRow.Hidden = True
End If
iRow = iRow + 1
Wend
For i = 1 To 2
Worksheets(i).EnableCalculation = True
Next
End Sub
'This will filter the table to the attribute in the Ethnicity drop down.
Sub EthnicityFilter()
For i = 1 To 2
Worksheets(i).EnableCalculation = False
Next
Dim rRange, TheRow As Range
Set rRange = Worksheets("Test Sheet").Range("E4:E400")
Dim iRow As Integer
iRow = 1
While rRange(iRow, 1).Value <> ""
'rRange(iRow, 1).Select
If rRange(iRow, 1).Value = Worksheets("Test Sheet").Range("I1").Value Then
rRange(iRow, 1).EntireRow.Hidden = False
Else
rRange(iRow, 1).EntireRow.Hidden = True
End If
iRow = iRow + 1
Wend
For i = 1 To 2
Worksheets(i).EnableCalculation = True
Next
End Sub
'This will unhide all rows
Sub Reset()
Rows("4:9").Select
Selection.EntireRow.Hidden = False
Rows("1").Select
End Sub