I am trying to define a dynamic range after an auto filter is applied, however in the 13th line of the following code, I know I need to replace "R20C10" with something that dynamically reflects the changing Row count. Any help would be appreciated!


Sheets("database").Select
    Range("A2:J2").Select
    Range(Selection, Selection.End(xlDown)).Select
    Selection.Copy
    Sheets("FilterCriteria").Select
    Range("A1").Select
    ActiveSheet.Paste
    Range("A2:J2").Select
    Range(Selection, Selection.End(xlDown)).Select
    Application.CutCopyMode = False
     ActiveWorkbook.Names("filter_data").Delete
    ActiveWorkbook.Names.Add Name:="filter_data", RefersToR1C1:= _
        "=FilterCriteria!R2C1:R20C10"
          FilteredLB.RowSource = ""
         FilteredLB.RowSource = "filter_data"