Option Explicit
Sub CopyPasteData()
Dim sourceWorkbook As Workbook
Dim destinationWorkbook As Workbook
Dim sourceSheet As Worksheet
Dim destinationSheet As Worksheet
' Set the source workbook (the workbook you want to copy data from)
Set sourceWorkbook = Workbooks("SourceWorkbook.xlsb")
' Set the destination workbook (the workbook you want to paste data into)
Set destinationWorkbook = Workbooks("DestinationWorkbook.xlsb")
' Set the source sheet (the sheet you want to copy data from)
Set sourceSheet = sourceWorkbook.Sheets("Sheet1")
' Set the destination sheet (the sheet you want to paste data into)
Set destinationSheet = destinationWorkbook.Sheets("Sheet1")
' Copy the data from source sheet
sourceSheet.Range("A1:B10").Copy
' Paste data to destination sheet at cell C1
destinationSheet.Range("C1").PasteSpecial Paste:=xlPasteValues
destinationSheet.Range("C1:D10").Interior.Color = vbGreen
End Sub
Bookmarks