Copy an entire worksheet to a new worksheet in Excel 2010

前端 未结 6 1446
长发绾君心
长发绾君心 2020-12-01 10:28

I have found similar questions that deal with copying an entire worksheet in one workbook and pasting it to another workbook, but I am interested in simply copying an entire

6条回答
  •  忘掉有多难
    2020-12-01 11:26

    I really liked @brettdj's code, but then I found that when I added additional code to edit the copy, it overwrote my original sheet instead. I've tweaked his answer so that further code pointed at ws1 will affect the new sheet rather than the original.

    Sub Test()
        Dim ws1 as Worksheet
        ThisWorkbook.Worksheets("Master").Copy
        Set ws1 = ThisWorkbook.Worksheets("Master (2)")
    End Sub
    

提交回复
热议问题