Copying columns

Overview

The [highlight txt=’copy column’] instruction allows a user to copy whole columns of data within a particular Excel worksheet into another Excel worksheet.

[message type=”warning”]For the purposes of this article we are going to use two simple and fictitious Excel files. They have already been uploaded into a data step. You will want to replace these files with those of your own.[/message]

Before we get started

Please further create a ‘Manipulate a file’ or ‘Multiple file manipulations’ action step so that you can add and use instructions.

The source file that we are going to use looks like this:

The target file that we are going to use is empty.

Steps

1. Create a ‘Copy column’ instruction.

2. Link the file named “Source” as the source file and the file named “Target” as the target file.

3. Select Sheet1 from both files.

4. Inside the source file Column field, type “A”. This will be where the starting point of the range of columns to be copied.

5. Type into the field to the right of the Column field or adjust the ticker next to this field to “2”. This specifies the number of columns to be copied, that is, the number of columns to the right of Column A (including Column A) that should serve as the source range.

6. Inside the target file Column field, type “A”. This specifies the column to which the range of data is to be copied. Please note that this instruction overwrites data in the target column. In this example, it means that this instruction does not insert the 2 columns of data from the source file to the left of Column A in the target file. Instead, the instruction will paste the 2 columns of data over Column A in the target file.

7. Save and run the step.

8. After the step finishes running, download and open the target file. It will resemble the image below:

As you can see, Column A from the source file has been copied to Column A in the target file while Column B from the source file has been copied to Column B in the target file.

Recent Posts

Leave a Comment