VBA - Copy sheetvalues, paste to sheet with a variable name
<p>I have a user form that allows people to input the date range of the series of data, which will then be later used to name the outputs from the rest of the macro. I am trying to copy all the values on the first sheet <code>WWOutput</code>, where all the data is analyzed/calculated and paste to a newly created sheet with the name of the variable <code>DateRange</code>, which will obviously change each time. </p>

<p>I am currently trying this: </p>

<pre><code>Worksheets.Add(Before:=Worksheets("Calc")).Name = DateRange.Value
Worksheets("WWOutput").Range("A1:Q1000000").Copy
Worksheets(DateRange).Range("A1").PasteSpecial Paste:=xlPasteValues
</code></pre>

<p>The new sheet is created and the worksheet is copied but it is not copying to the one I want. If I try <code>.Cells</code> instead of <code>.Range</code> it gives me "Type Mismatch"</p>

<p>What am I doing wrong?</p>

<p>Josh</p>