

Using the Range of cells, we can enter the value to the cell or cells, we can read or get values from the cell or cells, we can delete, we can format, and we can do many other things as well. Then in the worksheet, we need to mention the range of cells. Next, in the workbook, we are referring to which worksheet we are referring to.

Then under this, we need to refer to which workbook we are referring to. “Application > Workbook > Worksheet > Range”įirst, we need to access the Application. In VBA, we can classify the range as below. A range can contain a single cell, multiple cells, a row or column, etc. You are free to use this image on your website, templates, etc., Please provide us with an attribution link How to Provide Attribution? Article Link to be Hyperlinked

So when you want to play around with data, you must be a behavior pattern of cells in worksheets. In worksheets, it is cells containing the data. So, it is very important in the code to have a range variable set.Īfter working with Excel for so many years, you must have understood that all works we do are on the worksheet. If we do not provide a specific range to a code, it will automatically assume the range from the worksheet with the active cell. Set range in VBAmeans we specify a given range to the code or the procedure to execute.
