Select All Cells in Excel Using VBA – VBA Tutorials

Select All Cells
  • Save

Introduction/Problem Statement

In this blog, we will talk about how to select the entire worksheet in a workbook using VBA. To select all cells of a worksheet we can use it. cells property of the worksheet.


This code will select all cells of an active worksheet.

select the all cells
  • Save

Sub KDataScience_SelectAllCellsOfWorksheet()

End Sub

If we want to select all cells of a worksheet which is not an active worksheet then we need to first activate the worksheet then select the entire cells. If we do not activate the worksheet then it will show error.

select all cells of a worksheet
  • Save

Sub KDataScience_SelectEntireSheet()
    'To activate sheet
    'To select the entire cells of activesheet

End Sub


If you want to select entire cells of a worksheet then you can use any code shown above (according to one need).

Don't miss out!
Subscribe To Newsletter

Get the latest Excel, VBA, Automation, Tips & Tricks, delivered straight to your inbox.

Invalid email address
Give it a try. You can unsubscribe at any time.

Leave a Reply

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

Copy link
Powered by Social Snap