如何用代码从一个workbook复制需求列到另外的workbook,并对复制列更改列标题
用代码如何将已有文件AA中sheet1的“BB”,"CC"列复制到新文件DD的SHEET2中,并将列名分别更改为"EE"和"FF"
Private Sub Form_Load() Dim ex As New Excel.Application Dim books As Excel.Workbook Dim sht As Excel.Worksheet Dim sht2 As Excel.Worksheet Set ex = CreateObject("Excel.Application") Set books = ex.Workbooks.Open("C:\book.xlsx") Set sht = books.Sheets(1) Set sht2 = books.Sheets(2) sht.Range("c1:C3").Copy sht2.Paste sht2.Range("e1:e3") books.Save books.Close ex.Quit End Sub