Forum Discussion

chancelin's avatar
chancelin
Copper Contributor
Nov 27, 2018

Understanding the Offset Function

 

Hello to the whole family.
I want to understand this piece of code

Range("A1").End(xlDown).Offset(1, 0).Select

  • Willy Lau's avatar
    Willy Lau
    Steel Contributor

    The code is to find the last row of Column A that contains data and select the next row after that last row.

     

    If Column A have no data, it will generate an error because Excel will get to the last row of the worksheet and trying to move to the next row, but there is no next row.

     

    This is what I tried your code and interpret from the result only.  You can try it.

    • chancelin's avatar
      chancelin
      Copper Contributor

      Thank you for your response Willy Lau. My ideas are clearer. I am new to VBA programming

Resources