Be the first user to complete this post
|
Add to List |
VBA-Excel: CurrentRegion
CurrentRegion analyses the filled cells and the blank cells surrounded by the rangeyou provide. Its returns a Range object as a region in Mxn shape.
Syntax:
RangeObject. CurrentRegion
Example:
Function FnCurrentRegion() Dim mainWorkBook As Workbook Set mainWorkBook = ActiveWorkbook With mainWorkBook.Sheets("Sheet1") .Range("H2").Value = 5 .Range("I3").Value = 15 .Range("H2").Activate End With ActiveCell.CurrentRegion.Select End Function

Also Read:
- VBA-Excel: Create Array using Array() Function
- VBA-Excel: Convert Numbers (Rupees) into Words OR Text - Updated Till 1000000 Crore With Decimal Numbers
- VBA-Excel: Date-Time Functions – Day()
- VBA-Excel: Get all the WeekDays or Working days in Specified Date Range, (excluding Satudays and Sundays)
- VBA-Excel: Date-Time Functions – FormatDateTime()