Results 1 to 2 of 2
  1. #1
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919

    Get last row number in an Excel worksheet

    I tried the following line of code but Access compiler doesn't know about the xlUp in the End part. The intent is to find the last non-blank cell in column "L".



    Code:
    xlsApp.Worksheets("Membership").Cells(Rows.Count, "L").End(xlUp).Row

  2. #2
    GraeagleBill's Avatar
    GraeagleBill is offline Experienced Old Geezer
    Windows 10 Access 2013 32bit
    Join Date
    Feb 2011
    Posts
    1,919
    Found the list of Excel constants in solving this problem. I wonder now in hindsight if adding an Excel library reference would have cleared this up........... anyone know about such things.

    Solution:
    Code:
    xlsApp.Worksheets("Membership").Cells(xlsApp.Rows.Count, "L").End(-4162).Row

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Worksheet within Excel Workbook
    By rpkfish in forum Macros
    Replies: 4
    Last Post: 05-06-2016, 03:02 PM
  2. wrong excel worksheet opening
    By xopherira in forum Programming
    Replies: 8
    Last Post: 08-28-2015, 12:10 PM
  3. Export to excel but clear worksheet first
    By mercapto in forum Import/Export Data
    Replies: 3
    Last Post: 05-17-2015, 11:57 AM
  4. VBA to Import Excel Worksheet
    By bdaniel in forum Programming
    Replies: 2
    Last Post: 11-23-2010, 10:53 AM
  5. Importing the second excel worksheet
    By geoffwbailey in forum Programming
    Replies: 1
    Last Post: 06-25-2010, 12:16 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums