+ Reply to Thread
Results 1 to 5 of 5

Copy a row from one sheet to another and delete from first

  1. #1
    Registered User
    Join Date
    02-08-2024
    Location
    Miami, FL
    MS-Off Ver
    O365
    Posts
    2

    Copy a row from one sheet to another and delete from first

    I created a workbook for nonconformance's and want to use a VBA to copy a row from one spreadsheet (Service Nonconformance Tracker) to another spreadsheet (CA-PA Tracker) and delete the row from the first spreadsheet. The trigger for this to happen is when a cell in a column has the word "YES" from a dropdown added.

    The current VBA code I'm using is deleting the row from the first spreadsheet (Service Nonconformance Tracker) but I can't find where its being pasted after deletion. The VBA code I'm using is as follows:

    Please Login or Register  to view this content.
    Any help that can be provided would be much appreciated, as this has me stomped.


    v/r,
    Rodney

    Administrator's note: Please take the time to review our rules. There aren't many, and they are all important. Rule #1 requires good titles. "Need help with a VBA" doesn't tell us anything about your question. I have updated it for you this time because you are a new member. --6StringJazzer
    Last edited by 6StringJazzer; 02-09-2024 at 09:31 AM. Reason: AliGW added code tags; I fixed the title

  2. #2
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,942

    Re: Copy a row from one sheet to another and delete from first

    It's being put at the bottom of the sheet named CA-PA Tracker - go to that sheet and use Ctrl-End to find the last entry on the sheet. The code you have is poorly written and may be adding the data far down the sheet, so select column S, use GoTo Special Blanks OK and then delete entire rows.

    Here some clearer code:

    Please Login or Register  to view this content.
    Bernie Deitrick
    Excel MVP 2000-2010

  3. #3
    Registered User
    Join Date
    02-08-2024
    Location
    Miami, FL
    MS-Off Ver
    O365
    Posts
    2

    Re: Copy a row from one sheet to another and delete from first

    Bernie,

    First and foremost thank you for responding.

    The code you provided does work and the data is at the bottom of the page as you stated. Is there a way to code so that the copied data is entered into the next available row at the top of the spreadsheet (CA-PA Tracker)?

  4. #4
    Forum Expert
    Join Date
    02-11-2014
    Location
    New York
    MS-Off Ver
    Excel 365 (Windows)
    Posts
    5,942

    Re: Copy a row from one sheet to another and delete from first

    IF - If an available row is defined by not having an entry in column S, then try

    Please Login or Register  to view this content.

  5. #5
    Forum Expert sintek's Avatar
    Join Date
    12-04-2015
    Location
    Cape Town
    MS-Off Ver
    2013 | 2016 | 2019
    Posts
    13,192

    Re: Copy a row from one sheet to another and delete from first

    No need for loops here...can be simplified but no sample file...see yellow banner regarding sample file upload...
    Good Luck
    I don't presume to know what I am doing, however, just like you, I too started somewhere...
    One-day, One-problem at a time!!!
    If you feel I have helped, please click on the star to left of post [Add Reputation]
    Also....add a comment if you like!!!!
    And remember...Mark Thread as Solved.
    Excel Forum Rocks!!!

+ 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