title: Save range to variable
body: <p>I wrote some functional VBA:</p>
  
  <pre><code>Sheets("Src").Range("A2:A9").Copy Destination:=Sheets("Dest").Range("A2")
  </code></pre>
  
  <p>I want to extract the source range into a variable for flexibility.</p>
  
  <pre><code>SrcRange = Sheets("Src").Range("A2:A9")
  SrcRange.Copy Destination:=Sheets("Dest").Range("A2")
  </code></pre>
  
  <p>However, this doesn't work.
  What SrcRange should be Dimmed as? Is the first line even correct?<br>
  I tried Dimming SrcRange as Range and it gave me<br>
  <code>Runtime error 91: Object Variable or With block variable not set</code></p>
  
  <p>I'm not very familiar with the language and the documentation has left me wanting (I couldn't find the return type to the Sheets(index) invocation, <a href="http://msdn.microsoft.com/en-us/library/bb178404%28v=office.12%29.aspx" rel="noreferrer">this</a> was the closest I found). When I hit Record Macro, perform some actions, and hit stop, the Macro body is still blank.</p>
  
  <p>Could anyone shed some light on how to use SrcRange as a variable?</p>