Visual Basic for Applications (VBA) is a programming language that comes bundled with Microsoft Office programs, such as Excel. With VBA, you can create macros that will manipulate the Excel spreadsheet, moving the information from one cell to another, or creating formulas in a particular cell. VBA can also copy an entire column of data, so that you can paste it somewhere else.
- Skill level:
Open the Excel file. Press Alt and F11 to launch the VBA console window.
Click the module, on the left side of the VBA console, that holds the VBA code you want to work with. Click the right side of the screen to place your cursor in the code where you want to copy your column.
Enter "Columns("A:A").Select" and "Selection.Copy" (without quotes) into the VBA console. Change the "A" to whatever column you want to copy. The two letters may be different, if you want to copy a range of cells between two columns that the letters represent.
Tips and warnings
- The copy method also allows you to specify a destination for the copied cells. Enter "Destination:=Range("D1")" directly after the copy command, on the same line of code. Change "D1" to the cell or column where you want to paste the copied columns. If you don't include a destination, the column will be copied to the clipboard.
- 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