Results 1 to 6 of 6

Find last row

Threaded View

  1. #1
    Registered User
    Join Date
    04-03-2010
    Location
    Orlando, FL
    MS-Off Ver
    Office 365
    Posts
    94

    Find last row

    I need to find the last row of data, where the last data entry may be in different columns. I had been using this code, thinking that column B would contain the last data entry. This isn't always the case.
    Dim LastRowCopy As Long, LastRowPaste As Long
      
        LastRowCopy = Sheets("PCR Summary").Range("C" & Rows.Count).End(xlUp).Row               ' Last used row on "PCR Summary"
        
        Sheets("PCR Summary").Range("A1", "E" & LastRowCopy).Copy _
            Destination:=Sheets("PCR Parts Summary").Range("A1"
    I tried modifying the LastRowCopy line to say:
     LastRowCopy = Sheets("PCR Summary").Range("A:F" & Rows.Count).End(xlUp).Row               ' Last used row on "PCR Summary"
    but I get an error, Run-Time Error '1004, Application-defined or object defined error.
    ...anyone? Thanks in advance.
    Last edited by wpryan; 05-05-2010 at 11:57 AM. Reason: Solved

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1