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



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...
Select Ranges in the Worksheet from a UserForm
Tutorial: Select a range in Excel from a UserForm and have that range input into the form so that yo...
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...
Tutorial Details
Similar Content
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...
Select Ranges in the Worksheet from a UserForm
Tutorial: Select a range in Excel from a UserForm and have that range input into the form so that yo...
Excel Forum