title: Excel and Macros - Autofiltering using Data Validation
body: <p>I am auto filtering using data validation, the below code works if I have the data in the same spreadsheet. However, I have data in different sheets and I want them to filter based on the selection I make on the data validation list I created.
  Can some help please let me knowhow to resolve this issue.
  Thanks in advance!</p>
  
  <pre><code>Private Sub Worksheet_Change(ByVal Target As Range)
   Dim r As Range
   If Target.Address = "$C$2" Then
      Set r = Me.AutoFilter.Range
   If Len(Trim(Target.Value)) &gt; 0 Then
    r.AutoFilter Field:=1, Criteria1:=Range("C2").Value
   Else
    r.AutoFilter Field:=1
   End If
   End If
   End Sub
  </code></pre>