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

 

You may also like...

1 Response

  1. Hello there, just became aware of your blog through Google, and found that
    it’s really infor­ma­tive. I’m gonna watch out for brussels.

    I’ll be grate­ful if you con­tinue this in future. Lots of peo­ple will be ben­e­fited
    from your writ­ing. Cheers!

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: