Selecting Range with End Property – Example #4Īssume you have data as shown in the below image.
API VBA RANGE.CELLS() FULL
Selecting Range – Example #3įor example, if I want to select the range of cells from A1 to A13 in the workbook called “Example WB,” firstly, I need to specify the workbook name by using the Workbooks property, and I need to mention the full workbook name with its extension.Īfter selecting the Workbook, we need to select the worksheet using the Worksheet property. Similarly, if you select the range from different workbooks, you also need to specify the workbook name. This would also perform the same task as the previous one. Run this code using the F5 key or manually to see the result. As I have shown in the previous example, we can select the range of cells from A1 to A13 using the below method. You can supply the range in the first argument itself, or else you can supply it as two arguments as well. Irrespective of which sheet you are it will activate the Sheet 1 and select the range A1 to A13. If you want to select the cells in Sheet 1 only, then you need to supply this in code, as I have shown below.įirst, you need to activate the Worksheet name called “Sheet 1”, and then you need to select a range from A1 to A13.