Hi All,
I have an autofilter which works fine. However I would like to have the range in the autofilter to be dynamic and I can't figure out how to do this.
The first line is my attempt that doesn't work whilst the second line works but with a fixed range.
Thanks in advance
Tom
I have an autofilter which works fine. However I would like to have the range in the autofilter to be dynamic and I can't figure out how to do this.
Code:
'simswks.Range(Cells(1, 1), Cells(num + 1, 12)).AutoFilter Field:=10, Criteria1:=student
simswks.Range("A1:L81").AutoFilter Field:=10, Criteria1:=student
The first line is my attempt that doesn't work whilst the second line works but with a fixed range.
Thanks in advance
Tom