VBA-Excel: CurrentRegion

VBA-Excel: CurrentRegion

Cur­ren­tRe­gion analy­ses the filled cells and the blank cells sur­rounded by the rangeyou pro­vide. Its returns a Range object as a region in Mxn shape.

Syn­tax:

RangeObject. CurrentRegion

Exam­ple:

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

Cur­rent Region

Also Read about

Cells

Off­set

Range

Range By using A1 Notations

Refer to Cells by Using Short­cut Notation

Refer to Mul­ti­ple Ranges : Union Method

Loop­ing Through a Range of Cells

Select and Acti­vate Cells — Select

Select and Acti­vate Cells — Activate

3D-Ranges — Work­ing with Mul­ti­ple Work­Sheets At The Simultaneously.

Cre­ate Dynamic or Run-time Work­Sheets using Macro

3D-Ranges – Fil­lAcrossSheets Method

Cells Ranges Off­set — Active Cell

Cur­ren­tRe­gion

Happy Macro­ing :)

Sumit Jain

 

One thought on “VBA-Excel: CurrentRegion

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

%d bloggers like this: