title: How do I refer to an inactive sheet when doing a paste values?
body: <p>I am new to VBA in Excel. I am trying to write a code that pastes the value of a cell into another cell and then autofills to a specific range in the same column. How can I do this in the background without the sheet being active? This is the code that the Macro Recorder wrote:</p>
  
  <pre><code>Sheets("Results").Select
  Range("D8").Select
  Selection.Copy
  Range("E8").Select
  Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
      :=False, Transpose:=False
  Application.CutCopyMode = False
  Selection.AutoFill Destination:=Range("E2:E8"), Type:=xlFillDefault
  Range("E2:E8").Select
  Selection.AutoFill Destination:=Range("E2:E44"), Type:=xlFillDefault
  Range("E2:E44").Select
  Columns("E:E").EntireColumn.AutoFit
  </code></pre>