title: changing pivot table Report Filter with VBA
body: <p>I have a VBA code that changes the a pivot table Report Filter based on a cell.</p>
  
  <p>It all works fine with inputs that are alphanumeric. When the input is a number, I get an error.</p>
  
  <p>Here is the code:</p>
  
  <pre><code>Sub ProjSelect_PivotsUpdate()
      Dim Selected_Proj
  
      Selected_Proj = Worksheets("Parameters").Range("SelectedProj")
      ActiveSheet.PivotTables("PivotTable1").PivotFields("Project").ClearAllFilters
      ActiveSheet.PivotTables("PivotTable1").PivotFields("Project").CurrentPage = _
      Selected_Proj
  End Sub
  </code></pre>
  
  <p>Here is the error code:</p>
  
  <blockquote>
    <p>Run-time error '1004':</p>
    
    <p>Application-defined or object-defined error.</p>
  </blockquote>