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:
Other People Are Reading
Click the "Sheet1" tab and type "data in sheet 1" in A1. Click "Sheet2" and type "data in sheet 2" in A1.
Click the "Developer" tab, click "Visual Basic," and click the "Insert" menu. Click "Module" to insert a new code module.
Create a new sub procedure.
Private Sub copyDataBetweenSheets()
Add the following code to select the Sheet1 and copy the data in A1:
Sheets("Sheet1").Select Range("A1").Select Selection.Copy
Add the following code to select Sheet2 and paste the data copied from Sheet1:
Sheets("Sheet2").Select Range("A2").Select ActiveSheet.Paste
Select the data in cell A1 and copy it by adding the following code:
Paste the data you copied from Sheet2 by adding the following code:
Sheets("Sheet1").Select Range("A2").Select ActiveSheet.Paste
End the procedure by adding "End Sub." Press "F5" to execute the sub procedure.
- 20 of the funniest online reviews ever
- 14 Biggest lies people tell in online dating sites
- Hilarious things Google thinks you're trying to search for