Chapter 12. Working with Cells

Cut and Paste Ranges of Cells

Cut, Copy, and Paste are among the most commonly used commands, and you can find them in almost every application. When writing VBA code, you can use the Cut and Copy methods to cut, copy, and paste a range of cells. The following is the syntax for the Cut method (see "Copy and Paste Ranges of Cells" for an explanation of the Copy method):

expression.Cut(Destination)

The Cut method enables you to cut a range of cells and paste them either to the Windows Clipboard or to another range of cells. You can use the Cut method's optional Destination parameter to tell VBA where you want to paste. If you do not include a destination, VBA pastes to the Windows Clipboard.

If you include a destination, ...

Get Excel® Programming: Your visual blueprint™ for creating interactive spreadsheets now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.