currentregion property in vba

learning_grexcel

Active Member
Joined
Jan 29, 2011
Messages
319
I have only one column i.e. A with some values and I wanted to select the column using currentregion property.

I tried the code below, but it could not select anything. Is there any mistake?

Range("A1").currentregion.select


Of course, I know the other way to select is using code "Range("A:A").select" but I'm trying to learn currentregion property.
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Returns a Range object that represents the current region. The current region is a range bounded by any combination of blank rows and blank columns. Read-only.
it works on my test sheet
 
Upvote 0
Is there anything in A1 and B1 ??
You could also try
Code:
Sub MM3()
ActiveCell.CurrentRegion.Select
End Sub
 
Upvote 0
Is there anything in A1 and B1 ??
You could also try
Code:
Sub MM3()
ActiveCell.CurrentRegion.Select
End Sub
 
Upvote 0
OK, but remember....CurrentRegion is an area bounded by blanks.
So, if A1 has data and B1 AND C1 are blank A1 will be the currentregion
 
Upvote 0

Forum statistics

Threads
1,223,239
Messages
6,170,947
Members
452,368
Latest member
jayp2104

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