Wednesday, 6 May 2020

3 Easiest Way to Copy and Paste Data in Excel VBA


In this blog post, we are going to learn 3 best and easiest way to copy and paste data from one place to another within the same worksheet.



Below are these 3 methods:-

  1. Range.copy method
  2. Destination = Source Method
  3. Paste Special Method

First Method:

Range.Copy

Suppose that we have a dataset from Column “A1: A10” and we need to copy and paste this whole data into another location, such as in Column “D1: D10”.


Now we will apply the VBA code to copy and paste the above dataset in the desired location.

Please see below:-



First type “Range (“A1: A10”).copy and then press “Space bar”, this will ask the destination location. Then write code such as “Destination: = desired location Range”.

Here “C1: C10” is the desired range where we paste our dataset.


Second Method: 

Destination = Source Range

This is the second method, in this method we follow the rule of Excel VBA such as:-


Destination = Source Range




“Range where we want to paste our data" = "our source data range, which we want to copy”.




Destination: - This is the destination area where we want to paste our dataset within the worksheet.


Source Range: - Our source data, which we want to copy and paste it in another place.


Please see below the simple VBA coding:-




Third Method:- 

Paste Special

This is our third method to copy and paste dataset in Excel VBA.


Step 1. – In this method, first we will write down our code to copy data from source data.

Step 2- Then, write the code to paste the dataset into the destination field.

Step3:- Once the dataset is copied the “CutCopyMode” appears around whole the dataset. To remove this “CutCopyMode” we need to apply the code as shown in the image below.

“Application.CutCopyMode = False”.

 These are the three best and easiest VBA Codes to copy and paste the data from one to another place, within the same worksheet.

I hope you find this tutorial helpful.

Please feel free to put your comments and suggestion on this post.


Thanks and Regards





No comments:

Post a Comment

Featured post

Pivot Tables

Pivot Tables are one of the most useful tool in excel, and most excel experts says that this tool is the magic tool for quickly prepar...