Be the first user to complete this post

  • 0
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
Current Region
Current Region



Also Read:

  1. VBA-Excel : 3D-Ranges – FillAcrossSheets Method
  2. VBA-Excel: Date-Time Functions – Month(), Year() and MonthName()
  3. VBA Excel - Cells, Ranges and Offset: Refer to Cells by Using Shortcut Notation
  4. VBA-Excel: Select and Activate Cells - Select
  5. VBA-Excel: Cells Ranges Offset - Active Cell
  6. VBA-Excel : 3D-Ranges – FillAcrossSheets Method
  7. VBA-Excel: Clear data from Excel Sheet(WorkSheet)
  8. How to Enable Macro in Excel