Good morning. I'm attempting to use the following code to copy multiple ranges from one Excel workbook and paste the data into a newly created Excel workbook. It works perfectly except I'm struggling to find the proper syntax for referencing multiple ranges in the originating workbook. Thanks for chiming in with any feedback you might have.
Private Sub CommandButton1_Click()
Dim wbk As Workbook
Dim NewBook As Workbook
Set wbk = ActiveWorkbook
' http://stackoverflow.com/questions/19325865/excel-vba-copy-a-range-into-a-new-workbook
Set NewBook = Workbooks.Add
wbk.Worksheets("Presenting Problems & Progress").Range("A1:H100").Copy
NewBook.Worksheets("Sheet1").Range("A1").PasteSpecial (xlPasteValues)
Application.CutCopyMode = False
Unload Me
End Sub
The second range I would like to copy is ("Demographics").Range("E18:H32") and I'd like it to paste into the new workbook before the data already referenced in the above code.
Thanks.
Matthew
Bookmarks