• LAST free cell in row

    • This topic has 3 replies, 3 voices, and was last updated 16 years ago.
    Author
    Topic
    #457795

    How to have the number of last free cell in range A2:IV2…
    In this my case 4 (D2 is the free last cell)

    Viewing 1 reply thread
    Author
    Replies
    • #1148766

      You can use

      LastCol = Range(“IV2”).End(xlToLeft).Column + 1

      or if you want to be certain it’ll work in Excel 2007 and later too:

      LastCol = Cells(2, Columns.Count).End(xlToLeft).Column + 1

      • #1148953

        You can use

        LastCol = Range(“IV2”).End(xlToLeft).Column + 1

        or if you want to be certain it’ll work in Excel 2007 and later too:

        LastCol = Cells(2, Columns.Count).End(xlToLeft).Column + 1

        good!

    • #1150857

      How to have the number of last free cell in range A2:IV2…
      In this my case 4 (D2 is the free last cell)

      Doing it by means of a formula:

      Control+shift+enter, not just enter…

      =MATCH(2,1/(1-ISBLANK(A2:IV2)))+1

      If A2:IV2 is empty (unused), the result will be #N/A.

    Viewing 1 reply thread
    Reply To: LAST free cell in row

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: