title: Dynamic Excel VBA filter
body: <p>I have one macro which filters raw data according to fix criteria. I have assigned this macro on one button (Move In).<br><br>
  <a href="https://i.stack.imgur.com/Ns4nn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ns4nn.png" alt="enter image description here"></a><br><br>
  this macro is showing the details raw data for cell D11 (41 value)
  code is like   </p>
  
  <pre><code>Sub Jan_in()
  Application.ScreenUpdating = False
  Dim sStradd As String
  Sheets("Hiring_Attrition").Activate
  Range("A3").Select
  sStradd = ActiveCell.CurrentRegion.Address
  ActiveSheet.Range(sStradd).AutoFilter Field:=1, Criteria1:="Jan-17"
  Call clear
  Sheets("Hiring_Attrition").Activate
  ActiveSheet.Range("B3:H3").Select
  Sheets("Hiring_Attrition").Range(Selection, Selection.End(xlDown)).Select
  Selection.Copy Sheets("Report").Range("B8")
  Selection.AutoFilter
  Sheets("Report").Activate
  Sheets("Report").Range("B:H").EntireColumn.AutoFit
  Sheets("Report").Range("A1").Select
  Application.ScreenUpdating = True
  End Sub `
  </code></pre>
  
  <p>I have multiple macros like this but now I want a macro which pick filter according to cell reference. Like Macro will take criteria one as -2 row of same column for which selected cell is and criteria two -2 column of same row for which selected cell.</p>
  
  <p>Let me know if any further clarification is need.</p>