Cell Addresses of Current Region

animas

Active Member
Joined
Sep 28, 2009
Messages
396
Say my range is C3:F20. At certain point of time selected cell is like D7. So using CurrentRegion I can select C3:F20.

How do I easily set different parts of current region inside following variables:
Code:
TopLeft_Address
TopLeft_RowNum
TopLeft_ColumnNum

TopRight_Address
TopRight_RowNum
TopRight_ColumnNum


BottomLeft_Address
BottomLeft_RowNum
BottomLeft_ColumnNum

BottomRight_Address
BottomRight_RowNum
BottomRight_ColumnNum
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.
Code:
    With ActiveCell.CurrentRegion
        TopLeft_Address = .Cells(1).Address
        TopLeft_RowNum = .Row
        TopLeft_ColumnNum = .Column
 
        With Cells(.Row, .Columnns.Count + .Column - 1)
            TopRight_Address = .Address
            TopRight_RowNum = .Row
            TopRight_ColumnNum = .Column
        End With
 
        With Cells(.Row + .Rows.Count - 1, .Column)
            BottomLeft_Address = .Address
            BottomLeft_RowNum = .Row
            BottomLeft_ColumnNum = .Column
        End With
    End With
 
Last edited:
Upvote 0
Code:
With Cells(.Row, .Columnns.Count + .Column - 1)

Above line is giving following error:
"runtime error 438
Object Doesn't support this property or method."
 
Upvote 0

Forum statistics

Threads
1,224,595
Messages
6,179,798
Members
452,943
Latest member
Newbie4296

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top