+ Reply to Thread
Results 1 to 4 of 4

Paste last row

  1. #1
    Registered User
    Join Date
    06-13-2019
    Location
    London
    MS-Off Ver
    2018
    Posts
    20

    Paste last row

    Hey,
    I have a problem with the macro fragment that pastes data into Excel to me always from row A1 and I would like it to be pasted after the last filled line (sometimes the excel file is empty and sometimes it already contains some data). I have a request for help.

    Please Login or Register  to view this content.

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

    Re: Paste last row

    Hi Maxlond,

    You need a LastRow = Cells(Rows.Count,"A").End(xlUp).Row
    and then
    Cells(LastRow + 1, "A").Select

    The above replaces your Range("A1").Select
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    06-13-2019
    Location
    London
    MS-Off Ver
    2018
    Posts
    20

    Re: Paste last row

    Thanks but sometimes the data in Excel does not end in column A and between column A and column F. A in this case sticks to the completed row.

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

    Re: Paste last row

    Now I'm a little worried if your data looks differently based on what sheet you are working on.

    You might try "UsedRange" but if you have extra data on the worksheet this might not work either. See:

    https://www.automateexcel.com/vba/fi...w-column-cell/

+ 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: 11-29-2014, 01:14 PM
  2. copy formula and paste for new data added and autofill.....and paste special values
    By prabhuduraraj09 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-13-2014, 07:40 AM
  3. Replies: 7
    Last Post: 02-04-2014, 06:42 PM
  4. Trap Catch Differentiate Disable Paste Button from Paste Special Options
    By m3atball in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 10-23-2013, 07:28 PM
  5. [SOLVED] Need to modify the Paste function of this VBA Macro from "Paste" to "Paste Special Values"
    By zicitron in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-04-2013, 03:44 AM
  6. [SOLVED] how can I paste text using paste special, without clicking paste button?
    By Exxcel Noob in forum Excel General
    Replies: 6
    Last Post: 05-14-2012, 08:21 PM
  7. characters / paste special-paste link / absolute/relative default
    By LWD in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 12-29-2005, 08:20 PM

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