+ Reply to Thread
Results 1 to 16 of 16

How to: VBA paste UNDER last value?

  1. #1
    Registered User
    Join Date
    07-19-2019
    Location
    Holland
    MS-Off Ver
    Office Proffesional Plus 2016
    Posts
    26

    How to: VBA paste UNDER last value?

    Good afternoon,

    I wrote a code so the values are being copied and pasted on the address i manually selected. But i want to have it more efficient. It should copy UNDER the last value in a row. I am trying to get it done for hours already.

    Maybe someone could help me with this problem? (The reason why the data is on a strange place it the sheet "reference" is because i deleted everything wat was in front of it because it did contain personal data from people)

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by TimBell; 07-21-2019 at 09:43 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    11-28-2015
    Location
    indo
    MS-Off Ver
    2016 64 bitt
    Posts
    1,260

    Re: How to: VBA paste UNDER last value?

    Perhab
    Please Login or Register  to view this content.
    "ThankyouFor Attention * And Your Help!!"

  3. #3
    Registered User
    Join Date
    07-19-2019
    Location
    Holland
    MS-Off Ver
    Office Proffesional Plus 2016
    Posts
    26

    Re: How to: VBA paste UNDER last value?

    Thank you for your reply.

    Maybe my explanation wasn't that clear. Your code will past it directly under columA the first free cell. My intention is to find the last cell that holds any value, and to paste it under it.

  4. #4
    Valued Forum Contributor Naveed Raza's Avatar
    Join Date
    11-04-2012
    Location
    India, Hyderabad
    MS-Off Ver
    Excel, Access 2007/2010
    Posts
    1,338

    Re: How to: VBA paste UNDER last value?

    in Training tab in which column you want to paste data
    Thanks - Naveed
    -----------------------------
    If the suggestion helps you, then Click * to Add Reputation
    To Attach File: Go Advanced>>Manage Attachments>>Add Files (In Top Right Corner)>>SelectFiles>>.........Locate Your File(s)>>Upload Files>>Done (In Bottom Right)
    1. Use [code] code tags [\code]. It keeps posts clean, easy-to-read, and maintains VBA formatting.
    2. If you are happy with a solution to your problem, mark the thread as [SOLVED] using the tools at the top.

  5. #5
    Valued Forum Contributor Naveed Raza's Avatar
    Join Date
    11-04-2012
    Location
    India, Hyderabad
    MS-Off Ver
    Excel, Access 2007/2010
    Posts
    1,338

    Re: How to: VBA paste UNDER last value?

    if i understand clearing, you want to paste data under that column where Z23 (reference tab) is match in Training Tab row 23 right ?

  6. #6
    Registered User
    Join Date
    07-19-2019
    Location
    Holland
    MS-Off Ver
    Office Proffesional Plus 2016
    Posts
    26

    Re: How to: VBA paste UNDER last value?

    In my file, for example. L23 contais a value atm. So it should paste it under L23. But tomorror M23 holds a value, then it should go under M23, and so on

  7. #7
    Registered User
    Join Date
    07-19-2019
    Location
    Holland
    MS-Off Ver
    Office Proffesional Plus 2016
    Posts
    26

    Re: How to: VBA paste UNDER last value?

    so it should find the last cell that contains any value on row 23, and past it under that cell

  8. #8
    Valued Forum Contributor Naveed Raza's Avatar
    Join Date
    11-04-2012
    Location
    India, Hyderabad
    MS-Off Ver
    Excel, Access 2007/2010
    Posts
    1,338

    Re: How to: VBA paste UNDER last value?

    if it so then we should not look for the next empty column in 23rd row in Training Tab because you are not copying the date cell in reference tab.

    -- if we would be copy Z23 to Z28 then we can paste the data in next empty column in 23rd row in training tab. are you agree with this ?, shall we approach this way ?

  9. #9
    Valued Forum Contributor Naveed Raza's Avatar
    Join Date
    11-04-2012
    Location
    India, Hyderabad
    MS-Off Ver
    Excel, Access 2007/2010
    Posts
    1,338

    Re: How to: VBA paste UNDER last value?

    okay, you mean to say in 23rd row in training tab will have some date for next empty cell in 24th row right

  10. #10
    Registered User
    Join Date
    07-19-2019
    Location
    Holland
    MS-Off Ver
    Office Proffesional Plus 2016
    Posts
    26

    Re: How to: VBA paste UNDER last value?

    yes that is exactly what i mean

  11. #11
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,908

    Re: How to: VBA paste UNDER last value?

    Try:
    Please Login or Register  to view this content.
    Last edited by Phuocam; 07-21-2019 at 09:34 AM.

  12. #12
    Valued Forum Contributor Naveed Raza's Avatar
    Join Date
    11-04-2012
    Location
    India, Hyderabad
    MS-Off Ver
    Excel, Access 2007/2010
    Posts
    1,338

    Re: How to: VBA paste UNDER last value?

    if its so you can this code

    Please Login or Register  to view this content.

  13. #13
    Registered User
    Join Date
    07-19-2019
    Location
    Holland
    MS-Off Ver
    Office Proffesional Plus 2016
    Posts
    26

    Re: How to: VBA paste UNDER last value?

    Quote Originally Posted by Phuocam View Post
    Try:
    Please Login or Register  to view this content.
    Row 23 is not defined if i am correct. So it still depends on where you select any cell.

    @Naveed Raza, thanks mate! This is exactly what i was looking for, works like a charm ^^

  14. #14
    Valued Forum Contributor Naveed Raza's Avatar
    Join Date
    11-04-2012
    Location
    India, Hyderabad
    MS-Off Ver
    Excel, Access 2007/2010
    Posts
    1,338

    Re: How to: VBA paste UNDER last value?

    Glad its works like what your looking for please mark the case as solved and dont forget hit on Add Reputation

  15. #15
    Forum Guru
    Join Date
    02-27-2016
    Location
    Vietnam
    MS-Off Ver
    2016
    Posts
    5,908

    Re: How to: VBA paste UNDER last value?

    Quote Originally Posted by TimBell View Post
    Row 23 is not defined if i am correct.
    Change "Selection.Row" to 23 if you want

  16. #16
    Registered User
    Join Date
    07-19-2019
    Location
    Holland
    MS-Off Ver
    Office Proffesional Plus 2016
    Posts
    26

    Re: How to: VBA paste UNDER last value?

    Awsome, works aswell. Thanks for helping !

+ 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. 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
  2. Replies: 7
    Last Post: 02-04-2014, 06:42 PM
  3. 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
  4. [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
  5. [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
  6. Replies: 3
    Last Post: 04-13-2012, 12:26 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