Copy one range and paste in another range

Add to Favorites
Author: N/A

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)

    Windows("Book2").Activate

     'Select a single cell you wish to start your paste

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

    rngToCopy.Copy

    rngToPaste.Activate

    ActiveSheet.Paste Link:=True

End Sub


Question? Ask it in our Excel Forum


Excel VBA Course
Excel VBA Course - From Beginner to Expert

200+ Video Lessons 50+ Hours of Instruction 200+ Excel Guides

Become a master of VBA and Macros in Excel and learn how to automate all of your tasks in Excel with this online course. (No VBA experience required.)

View Course

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 ...
Odd or Even Row Formulas in Excel
Tutorial: Formulas to determine if the current cell is odd or even; this allows you to perform speci...
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...
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 ...
Tutorial Details
Excel VBA Course
Excel VBA Course - From Beginner to Expert

200+ Video Lessons
50+ Hours of Video
200+ Excel Guides

Become a master of VBA and Macros in Excel and learn how to automate all of your tasks in Excel with this online course. (No VBA experience required.)

View Course