Excel VBA Copy a Range into a New Workbook

后端 未结 1 1776
暗喜
暗喜 2020-12-13 22:55

I am a newbie to Excel VBA.

I am trying to copy a range of data from worksheet output into a new excel workbook and save the new workbook with the the v

相关标签:
1条回答
  • 2020-12-13 23:12

    Modify to suit your specifics, or make more generic as needed:

    Private Sub CopyItOver()
      Set NewBook = Workbooks.Add
      Workbooks("Whatever.xlsx").Worksheets("output").Range("A1:K10").Copy
      NewBook.Worksheets("Sheet1").Range("A1").PasteSpecial (xlPasteValues)
      NewBook.SaveAs FileName:=NewBook.Worksheets("Sheet1").Range("E3").Value
    End Sub
    
    0 讨论(0)
提交回复
热议问题