Copy an entire worksheet to a new worksheet in Excel 2010

前端 未结 6 1454
长发绾君心
长发绾君心 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:15

    'Make the excel file that runs the software the active workbook
    ThisWorkbook.Activate
    
    'The first sheet used as a temporary place to hold the data 
    ThisWorkbook.Worksheets(1).Cells.Copy
    
    'Create a new Excel workbook
    Dim NewCaseFile As Workbook
    Dim strFileName As String
    
    Set NewCaseFile = Workbooks.Add
    With NewCaseFile
        Sheets(1).Select
        Cells(1, 1).Select
    End With
    
    ActiveSheet.Paste
    

提交回复
热议问题