+ Reply to Thread
Results 1 to 6 of 6

Next Available Row

  1. #1
    Registered User
    Join Date
    11-01-2023
    Location
    San Diego, CA
    MS-Off Ver
    Office 2016
    Posts
    3

    Question Next Available Row

    I have this code i have wrote below but have some problems occuring i can't seem to figure out. I have put the code that needs to be changed in bold:

    Please Login or Register  to view this content.
    The existing code i have moves a command button and macro function to the active cell row. The problem that I'm having is after copying the cells i need, it overwrites previous data in RANGE N41. I need it to paste in the next empty cell in range N41:N48.. The next problem i am having is clearing the contents of where the original cells were copied. After pasting, the code selects a different cell and changes the active row. This makes it clear contents of the incorrect row. I tried clearing contents of the row after copying, but this clears what was copied to clipboard as well and gives me an error. Is there a way i can store the correct row as a variable and reference later in code?
    Last edited by AliGW; 11-01-2023 at 11:44 AM. Reason: Code tags added - please review the forum guidelines.

  2. #2
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: Next Available Row

    Hi there,

    See if the following code does what you need:

    Please Login or Register  to view this content.

    Hope this helps - please let me know how you get on.

    Regards,

    Greg M

  3. #3
    Registered User
    Join Date
    11-01-2023
    Location
    San Diego, CA
    MS-Off Ver
    Office 2016
    Posts
    3

    Re: Next Available Row

    This works as intended and fills the next empty row. But, It still doesn't clear contents of where the cells were copied from.

  4. #4
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: Next Available Row

    Hi again,

    Sorry, I was concentrating so much on the Paste destination that I overlooked the need to clear the source cells - my bad

    See if the following code does what you need:

    Please Login or Register  to view this content.

    Hope this helps - as before, please let me know how you get on.

    Regards,

    Greg M

  5. #5
    Registered User
    Join Date
    11-01-2023
    Location
    San Diego, CA
    MS-Off Ver
    Office 2016
    Posts
    3

    Re: Next Available Row

    It works perfect. Thank you very much!

  6. #6
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: Next Available Row

    Hi again,

    Many thanks for your feedback - much appreciated!

    You're welcome - glad I was able to help.

    Regards,

    Greg M

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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