Copy an entire worksheet to a new worksheet in Excel 2010 Copy an entire worksheet to a new worksheet in Excel 2010 vba vba

Copy an entire worksheet to a new worksheet in Excel 2010


It is simpler just to run an exact copy like below to put the copy in as the last sheet

Sub Test()Dim ws1 As WorksheetSet ws1 = ThisWorkbook.Worksheets("Master")ws1.Copy ThisWorkbook.Sheets(Sheets.Count)End Sub


ThisWorkbook.Worksheets("Master").Sheet1.Cells.Copy _    Destination:=newWorksheet.Cells

The above will copy the cells. If you really want to duplicate the entire sheet, then I'd go with @brettdj's answer.


' Assume that the code name the worksheet is Sheet1' Copy the sheet using code name and put in the end.' Note: Using the code name lets the user rename the worksheet without breaking the VBA codeSheet1.Copy After:=Sheets(Sheets.Count)' Rename the copied sheet keeping the same name and appending a string " copied"ActiveSheet.Name = Sheet1.Name & " copied"