Thanks Thanks:  0
Likes Likes:  0
Results 1 to 2 of 2

Thread: Can I count on finding last used cell...Thanks Dave. Works

  1. #1
    Board Regular
    Join Date
    Mar 2002
    Location
    Cincinnati, Ohio, USA
    Posts
    6,824
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi

    I need the last used cell/row or a total count of all used cells in coumn A.

    When the sheet is empy, this line of code assigns the value of 17?

    There are currently 25 rows filled with values from A1:A25

    Still assigns the value of 17?

    What's wrong with the code?

    Thanks in advance!

    Tom

    The search utility is not working on Mr Excel

    LastRowUpdate = Workbooks(FileToOpen).Sheets("sheet1").Range("a1:a" & Range("A65536").End(xlUp).Row).Rows.Count


    [ This Message was edited by: TsTom on 2002-03-27 03:47 ]

    [ This Message was edited by: tstom on 2002-03-27 03:54 ]

  2. #2
    Rest in Peace
    Join Date
    Feb 2002
    Posts
    1,582
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Default

    Hi Tom

    Try

    With Workbooks(FileToOpen).Sheets("sheet1")
    LastRowUpdate = .Range("A1", .Range("A65536").End(xlUp)).Row
    End With


    Or better still

    With Workbooks(FileToOpen).Sheets("sheet1")
    LastRowUpdate = WorksheetFunction.CountA(.Columns(1))
    End With

Some videos you may like

User Tag List

Like this thread? Share it with others

Like this thread? Share it with others

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •