Hi everyone,

I've been looking a lot on this forum lately and decided to ask for help about a problem that's been bugging me for days (first time posting).
Thanks in advance! Seriously that would be a huge help... im completly stuck.

Here's the situation:


- 10 cell long X 20 row large excel table with occasionnal "A" , "B" or "C" in cells. Header is week# (10,11,12...20)
- I want to filter between any 2 weeks (exemple: all row with "B" between week "10" and "14") specified in 2 designated cells (ex: Start = G1 and End= G2)

Here's the strategy used (but not enough) :

- In another sheet, make 3 times (1 for each letter "A", "B", "C", 10X10 cell criteria list with header week# (10,11,12...20), in the format of 1 criteria per row

- Use function to convert week# to cell position
- Use variable to store start (s1) and end (s2) position as number
- Use the advanced filter macro

Here's the problem-

I get some empty row when i filter. For exemple if i want week 11 to 13 (B1 to D6), i will have emtpy criteria row and filter wont work correctly because he will take "blank" as a criteria, which i dont want.

- Having the dynamic range cause me a lot more problem than i though. I tried something like:
test_range = Range(Cells(1, s1), Cells(5, s2)) but it doesnt work...

Here's the code

Added to the blank row, i cant get the dynamic part working well either. I tried something like this:

Dim test_range As Range
Dim s1 as integer
Dim s2 as integer

s1 = range("Z10") 'just consider its correct value for now
S2 = range("Z11") 'just consider its correct value for now

Set test_range = Range(Cells(1, s1), Cells(6, s2)) 'here 1 is the first row and 6 is the last row of the criteria table

Range("A1:E7").AdvancedFilter Action:=xlFilterInPlace, CriteriaRange:= _
Range(test_range), Unique:=False


So to resume, i need help on how to get past empty row problem and dynamic colomn selection. Would be very appreciated!