How to Select All Cells using Excel VBA?

One of the easiest way to select all cells from the current worksheet using Excel VBA is using the cells property of the Worksheet and the calling the Select function without specifying the index or name of the cell.

How to Select All Cells using Excel VBA?

For example, below is a code snippet that selects all the cells from the worksheet “TestWorkSheet”.

Sub DP_SelectAllCells()

     TestWorkSheet.Activate

     TestWorkSheet.Cells.Select

End Sub

Leave A Reply

Your email address will not be published. Required fields are marked *

You May Also Like

In this post, you’ll learn how to Find Blank cells in excel so that you can remove or delete the blank cells form...
In this article, you’ll learn what is a Gauge Chart in Microsoft Excel. Also, you will learn how to add...
Microsoft Excel provides a shortcut for the users to move columns in excel using two different ways – using Shift...