Copy The Data from Source To Destination

     

    Copy The Data from Source To Destination Workbook

     

     

    Click on Image to Watch Video:

     

     

    Sub Copy_The_Data_From_One_Workbook_To_Another()

    'Declare The Source Workbook
    SFilename = Application.GetOpenFilename
    Workbooks.Open (SFilename)
    Dim SWkb As Workbook
    Set SWkb = ActiveWorkbook

    'Declare Destination Workbook
    DFilename = Application.GetOpenFilename
    Workbooks.Open (DFilename)
    Dim DWkb As Workbook
    Set DWkb = ActiveWorkbook

    'Define Source Range
    Dim SrcRng As Range
    Set SrcRng = Application.InputBox("Select The Source Range To Copy", "www.Tricks12345.com", Type:=8)

    'Define Destination Range
    Dim DestRng As Range
    Set DestRng = Application.InputBox("Select The Destination Range To Paste", "www.Tricks12345.com", Type:=8)

    SrcRng.Copy DestRng

    'Save and Close source workbook
    With SWkb
    .Save
    .Close
    End With

    'Save and close the Destination workbook
    With DWkb
    .Save
    .Close
    End With

    Set DestRng = Nothing
    Set SrcRng = Nothing
    Set SWkb = Nothing
    Set DWkb = Nothing
    End Sub

    Download The Workbook