

Cell 2)Ĭell 1 (required) = The actual range/cell to be acted on. The basic syntax of the VBA range command is as follows: Range(Cell 1. You will use the Range function a lot in your VBA programming since it makes selecting a cell or a range of cells so effortlessly easy. As of now, Excel does not support multi-dimensional ranges (i.e. Multiple non-contiguous cells – the same as CTRL + Clicking cellsĮvery cell selected in the range must be within the same worksheet. One cell (even a single cell selection is called a range) What is Range?Ī range, as you might have guessed, refers to a cell or a range of cells. For a more in-depth discussion on selecting ranges in VBA, consider taking this course on Visual Basic for MS Excel.

I’ll also show you practical examples on how you can do this in your Excel workbooks. Every Excel user is familiar with selecting a range of cells – by SHIFT + Clicking, CTRL + Clicking, or dragging the mouse over a range of cells.īut how does one select a range in VBA? In this article, I’ll guide you on how to select a range of cells and activate a particular cell in that range.
