-
Copy Worksheet
I have an Excel workbook with one sheet named "Template"
I obviously want to use that template sheet to create new sheets.
How do I copy that sheet to a new sheet?
I've scoured google and it's killing me that I can't find an applicable answer.
This question must have been asked and answered many times.
Dim xlapp As Excel.Application, xlworkbook As Excel.Workbook, xlworksheet As Excel.Worksheet
-
Re: Copy Worksheet
Hello,
Have a look here and here
regards
-
Re: Copy Worksheet
Thanks Delany.
Ended up using
Code:
xlworksheet = xlworkbook.Sheets("Sheet1") 'Set sheet to be copied
xlworksheet.Copy(Type.Missing, xlworkbook.Sheets(xlworkbook.Sheets.Count)) 'Copy as new sheet at end
xlworksheet = xlworkbook.Sheets(xlworkbook.Sheets.Count) 'Set new sheet as one to work with
-
Re: Copy Worksheet
Thanks Delany.
Ended up using
Code:
xlworksheet = xlworkbook.Sheets("Sheet1") 'Set sheet to be copied
xlworksheet.Copy(Type.Missing, xlworkbook.Sheets(xlworkbook.Sheets.Count)) 'Copy as new sheet at end
xlworksheet = xlworkbook.Sheets(xlworkbook.Sheets.Count) 'Set new sheet as one to work with