Be the first user to complete this post
|
Add to List |
VBA Excel - Cells, Ranges and Offset: Refer Range by using A1 Notations
In the earlier tutorial (Range), you have seen how you use Range property. In this tutorial you will see the many different ways to use Range property to refer the excel sheet’s rows and columns.
Reference - Range (“A1”)
- Refer Cell A1
Reference – Range (“A1:D10”)
- Refer all the cells from A1 to D10 ( The entire MxN matrix)
Reference – Range(“A1:C3”,”D5:H7”)
- Refer all the cells from A1 to C3 and D5 to H7
Reference – Range(“A:A”)
- Entire Column A
Reference – Range(“A:F”)
- Columns from A to F
Reference – Range(“A:A”,”M:M”)
- Columns A and M
Similarly you can write the reference for rows
Reference – Range(“2:2”)
- Entire Row 2
Reference- Range(“2:5”)
- All the rows from 2 to 5
Reference – Range (“3:3”,”5:5”)
- Rows 3 and 5
Also Read:
- VBA-Excel: Copy/Paste data - Copy the Entire data from one sheet to another
- VBA-Excel: Copy/Paste data - Copy the data from a call and paste it to another cell
- VBA-Excel: User Forms
- VBA-Excel: Add Worksheets For All The Given Dates Except Weekends and Copy The Common Template In Each Worksheet
- Excel Macro - Visual Basic Editor