+ Reply to Thread
Results 1 to 12 of 12

How to copy from the next Row when I Run Code again

  1. #1
    Registered User
    Join Date
    08-07-2022
    Location
    Canada
    MS-Off Ver
    2021
    Posts
    39

    How to copy from the next Row when I Run Code again

    Hi,
    I want that Code should copy this Range Q10:T10. And Paste into this Range Q7:T7 as simple Numbers. If i run this code again then it should copy this Range Q11:T11. And Paste into this Range Q7:T7 as simple Numbers. If i Run this Code again then it should copy this Range Q12:T12. And Paste into this Range Q7:T7 as simple Numbers. And so on. But when it reaches blank cells below to Q10:T10. And i run this code again then it should show a message saying "Task has been Completed"

    Please see attached file for more clarification

  2. #2
    Valued Forum Contributor
    Join Date
    06-29-2014
    Location
    Australia
    MS-Off Ver
    MSO 365
    Posts
    1,098

    Re: How to copy from the next Row when I Run Code again

    Hello A1256,

    A double click event code would suit this scenario:-

    Please Login or Register  to view this content.
    Double click on any cell in the range Q10:Q34 and the four columns of data in the relevant row will be copied to Q7 and so on.

    To implement this code:-

    - Right click on the sheet tab.
    - Select "View Code" from the menu that appears.
    - In the big white code field that then appears, paste the above code.

    I hope that this helps.

    Cheerio,
    vcoolio.

  3. #3
    Registered User
    Join Date
    08-07-2022
    Location
    Canada
    MS-Off Ver
    2021
    Posts
    39

    Re: How to copy from the next Row when I Run Code again

    Hi vcoolio,

    Thank you for this. But I need a Code that would work without Double Click on Cell. I only want to press F5, and code should do this task.

  4. #4
    Registered User
    Join Date
    08-07-2022
    Location
    Canada
    MS-Off Ver
    2021
    Posts
    39

    Re: How to copy from the next Row when I Run Code again

    Hi Please anybody solve my issue. Thank you so much

  5. #5
    Registered User
    Join Date
    08-07-2022
    Location
    Canada
    MS-Off Ver
    2021
    Posts
    39

    Re: How to copy from the next Row when I Run Code again

    Hi Please anybody solve my issue. Thank you so much

  6. #6
    Forum Contributor
    Join Date
    12-10-2013
    Location
    Mississippi, United States
    MS-Off Ver
    2016
    Posts
    120

    Re: How to copy from the next Row when I Run Code again

    If You can use a Helper Column, I used V in for this example, the following code should work for you
    Please Login or Register  to view this content.
    Last edited by aworfolk; 08-10-2022 at 12:11 PM.

  7. #7
    Registered User
    Join Date
    08-07-2022
    Location
    Canada
    MS-Off Ver
    2021
    Posts
    39

    Re: How to copy from the next Row when I Run Code again

    Hi aworfolk,

    Thank you for this. But i could not use it. I am getting "Run-time error 13". This may be a mistake from my side as i have zero knowledge about vba coding. Please put this code in the attached excel file. And share withe me the attached file. I will be really very thankful to you.

  8. #8
    Forum Contributor
    Join Date
    12-10-2013
    Location
    Mississippi, United States
    MS-Off Ver
    2016
    Posts
    120

    Re: How to copy from the next Row when I Run Code again

    Here is the File with the code built into it.
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    08-07-2022
    Location
    Canada
    MS-Off Ver
    2021
    Posts
    39

    Re: How to copy from the next Row when I Run Code again

    Hi aworfolk,

    Can you please share excel file of format .xlsx‎ instead of .xlsb‎?

  10. #10
    Forum Contributor
    Join Date
    12-10-2013
    Location
    Mississippi, United States
    MS-Off Ver
    2016
    Posts
    120

    Re: How to copy from the next Row when I Run Code again

    I can change it to a .xlsm but for there to be stored code in the file it can not be a .xlsx. Sorry but that is the best I can do.
    Attached Files Attached Files

  11. #11
    Registered User
    Join Date
    08-07-2022
    Location
    Canada
    MS-Off Ver
    2021
    Posts
    39

    Re: How to copy from the next Row when I Run Code again

    Hi aworfolk,

    Thank you so much for your time and efforts. It worked perfectly as i wanted. Thanks again.

  12. #12
    Valued Forum Contributor
    Join Date
    08-08-2022
    Location
    Buenos Aires
    MS-Off Ver
    Excel 2019
    Posts
    1,777

    Re: How to copy from the next Row when I Run Code again

    Quote Originally Posted by A1256 View Post
    Can you please share excel file of format .xlsx‎ instead of .xlsb‎?
    The xlsx extension books cannot operate macros, so the xlsm or xlsb extension books are used.

+ 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. [SOLVED] vba code to copy charges code,their respective cells and sum their amount
    By JEAN1972 in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-12-2017, 08:46 AM
  2. [SOLVED] Need VBA code to lookup vaue through micr code copy matching rows to under group
    By johnmacpro in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-08-2016, 12:25 AM
  3. [help with code] need to update existing code to copy and keep rows on input page
    By scott micklo in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-25-2016, 01:36 PM
  4. Tool or code to copy VBA code to OneNote or Word while preserving VBA formatting
    By gregersdk in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-05-2015, 04:07 PM
  5. Replies: 2
    Last Post: 12-17-2013, 11:51 AM
  6. VBA code needed deserately for similar cells but do not know how to copy code!
    By Gunner_gav in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-19-2013, 03:39 AM
  7. [SOLVED] VBA Code to Save Copy File without Macro Button and VBA Code on Copy?
    By cychua in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 10-12-2012, 07:23 AM

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