+ Reply to Thread
Results 1 to 3 of 3

Problem with last row data completing

  1. #1
    Registered User
    Join Date
    02-28-2017
    Location
    Chile
    MS-Off Ver
    2010
    Posts
    9

    Problem with last row data completing

    Hello everyone!

    I'm programming a macro for a customer that writes data in the last row comparing it with another workbook. The problem is the macro writes the data in the same row always. I tried with the object defined as "LR" and used Offset (1,0) option for select last row... but it doesn't work

    Here is my code:
    Please Login or Register  to view this content.
    Thx for your help
    Last edited by REspina; 05-25-2017 at 12:05 PM.

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,168

    Re: Problem with last row data completing

    Hi,

    Set LR = Workbooks(Destino).Sheets("Planilla Metros Mes").Range("A999999:R999999").End(xlUp).Rows << Doesn't look right....

    Try this instead:

    LR = Workbooks(Destino).Sheets("Planilla Metros Mes").Cells(Rows.Count,,"A").End(xlUp).Row

    Then add 1 to LR to get the next blank row.

    http://www.rondebruin.nl/win/s9/win005.htm

    Rows.Count may be a different number depending on which version of Excel you are using. Newer versions have a lot more rows.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    02-28-2017
    Location
    Chile
    MS-Off Ver
    2010
    Posts
    9

    Re: Problem with last row data completing

    I have a problema when I add 1 to LR. I realized LR isn't the last rows but its the second last when loops after writing the destiny file.


+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 3
    Last Post: 03-23-2014, 02:06 PM
  2. Need help completing a graph
    By Kimatsu in forum Excel General
    Replies: 0
    Last Post: 01-09-2014, 02:01 PM
  3. Need help with completing an IF function
    By benburrows in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 05-15-2013, 07:31 AM
  4. Completing partially-filled data
    By Pete_UK in forum Excel Tips
    Replies: 8
    Last Post: 08-13-2012, 10:56 AM
  5. For Loop not completing
    By somnath.deb in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 09-01-2011, 11:55 PM
  6. Start filling data in a range after completing another??
    By Zhennie in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-26-2009, 03:16 AM
  7. Need some help completing this Formula
    By brigsaz in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 09-23-2005, 12:05 AM

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