title: Using a variable as a sheet name
body: <p>I am getting a RunTime 13 error when trying to use a variable for a sheetname as per below:</p>
  
  <pre><code>Sub inputdata()
  
  Set asheet1 = ThisWorkbook.Worksheets("input").Range("D12")
  Set rangeDate = ThisWorkbook.Worksheets("input").Range("inputdate")
  
  Range("F12:M12").Copy
  Sheets(asheet1).Select
  </code></pre>
  
  <p>It is erroring on the line Sheets(asheet1).Select</p>
  
  <p>Any help would be great thanks!</p>