How to Copy Between Sheets in Excel & VBA

Written by jaime avelar
  • Share
  • Tweet
  • Share
  • Pin
  • Email
How to Copy Between Sheets in Excel & VBA
User the system clipboard to copy data in Excel. (Comstock/Comstock/Getty Images)

Being able to copy data from one worksheet to another in Excel saves the user time since he doesn't have to copy it manually. The best way to copy data between sheets is to use the system clipboard. In VBA, you can use the "Select" property to select a worksheet and you can use the "Selection" object to copy data to the system clipboard. The "Paste" method pastes the contents of the clipboard onto the sheet that's currently selected.

Skill level:
Moderate

Other People Are Reading

Instructions

  1. 1

    Click the "Sheet1" tab and type "data in sheet 1" in A1. Click "Sheet2" and type "data in sheet 2" in A1.

  2. 2

    Click the "Developer" tab, click "Visual Basic," and click the "Insert" menu. Click "Module" to insert a new code module.

  3. 3

    Create a new sub procedure.

    Private Sub copyDataBetweenSheets()

  4. 4

    Add the following code to select the Sheet1 and copy the data in A1:

    Sheets("Sheet1").Select
    
    Range("A1").Select
    
    Selection.Copy
    
  5. 5

    Add the following code to select Sheet2 and paste the data copied from Sheet1:

    Sheets("Sheet2").Select
    
    Range("A2").Select
    
    ActiveSheet.Paste
    
  6. 6

    Select the data in cell A1 and copy it by adding the following code:

    Range("A1").Select
    
    Selection.Copy
    
  7. 7

    Paste the data you copied from Sheet2 by adding the following code:

    Sheets("Sheet1").Select
    
    Range("A2").Select
    
    ActiveSheet.Paste
    
  8. 8

    End the procedure by adding "End Sub." Press "F5" to execute the sub procedure.

Don't Miss

Filter:
  • All types
  • Articles
  • Slideshows
  • Videos
Sort:
  • Most relevant
  • Most popular
  • Most recent

No articles available

No slideshows available

No videos available

By using the eHow.co.uk site, you consent to the use of cookies. For more information, please see our Cookie policy.