Copy one range and paste in another range

Add to Favorites

Below is a macro, just copy and paste it into a module in your workbook and go from there.

This macro uses message boxes to help you select the range to copy and paste but it can easily be modified to fit into any macro where you may need it.

Sub PasteLink()

    Dim rngToCopy As Range

    Dim rngToPaste As Range

     'Select your range to copy

    Set rngToCopy = Application.InputBox("Select range in Book A", Type:=8)


     'Select a single cell you wish to start your paste

    Set rngToPaste = Application.InputBox("Select range to Paste in Book B", Type:=8)



    ActiveSheet.Paste Link:=True

End Sub

Similar Content on TeachExcel
Copy and Paste Data using Macro VBA in Excel
Tutorial: How to copy and paste data using a Macro in Excel. I'll show you multiple ways to do this,...
3D References - Formulas that Reference Multiple Sheets at Once in Excel
Tutorial: Have one simple formula that will reference the same cell or range of cells on multiple w...
Introducing Logic into Formulas and Functions in Excel
Tutorial: In this tutorial I am going to introduce the idea of Logic in Formulas. A Logic test is a ...
Limit the Total Amount a User Can Enter into a Range of Cells in Excel
Tutorial: How to limit the amount that a user can enter into a range of cells in Excel.  This works ...
Multiply by True and False in Excel
Tutorial: You can multiply numbers by TRUE and FALSE in Excel. This effectively allows you to elimi...
Loop through a Range of Cells in Excel VBA/Macros
Tutorial: How to use VBA/Macros to iterate through each cell in a range, either a row, a column, or ...