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 article, you will learn about the SKEW.P function, the formula syntax and usage of the function in Microsoft...
In this article, you will learn about the SKEW function, the formula syntax and usage of the function in Microsoft...
In this article, you will learn about the RANK.EQ function, the formula syntax and usage of the function in Microsoft...
  • Excel
  • November 23, 2021