title: How to paste a single value into filtered cells only using macros?
body: <p>I copy one cell ("A2") in excel, then on a different Sheet I filter the first column with some values. In the second column I want to paste the value which I copy from A2. How can I do that using macros?</p>
  
  <pre><code>Col1    Col2
  a   
  b   
  b   
  a   
  </code></pre>
  
  <p>At the end I want to see:</p>
  
  <pre><code>Col1    Col2
  a        10
  b   
  b   
  a        10
  </code></pre>
  
  <hr>
  
  <pre><code>Sub Macro()
      Range("A1").Select
      ActiveCell.FormulaR1C1 = "a"
      Sheets("Sheet2").Select
      Cells.Select
      Selection.AutoFilter
      ActiveSheet.Range("$A$1:$B$5").AutoFilter Field:=1, Criteria1:="a"
      Range("B2:B5").Select
  End Sub
  </code></pre>
  
  <p>The code is not complete of course.</p>