+ Reply to Thread
Results 1 to 18 of 18

Code that copies row of data to another sheet based on text "Complete"/"Delete"

  1. #1
    Registered User
    Join Date
    04-20-2014
    Location
    London
    MS-Off Ver
    Windows Excel 2010
    Posts
    79

    Code that copies row of data to another sheet based on text "Complete"/"Delete"

    12345678910
    Last edited by Dremzy; 04-23-2014 at 08:14 AM.

  2. #2
    Valued Forum Contributor
    Join Date
    07-04-2012
    Location
    Cape Town, RSA
    MS-Off Ver
    Office 365 ProPlus
    Posts
    1,050

    Re: NEED HELP! Code that copies row of data to another sheet based on text "Complete"/"Del

    Hi,

    The code below should do what you need. It is connected to the change event on each sheet, so all you have to do is type "Complete" or "Delete in the "G" column and the data will transfer. See the sample workbook for details...

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Regards,
    Rudi

  3. #3
    Forum Expert Mumps1's Avatar
    Join Date
    10-10-2012
    Location
    Toronto, Canada
    MS-Off Ver
    Excel 2010, 2013
    Posts
    7,815

    Re: NEED HELP! Code that copies row of data to another sheet based on text "Complete"/"Del

    Copy and paste this macro into the worksheet code module. Do the following: right click the tab for your Sheet1 and click 'View Code'. Paste the macro into the empty code window that opens up. Close the code window to return to your sheet.
    Please Login or Register  to view this content.
    You can say "THANK YOU" for help received by clicking the Star symbol at the bottom left of the helper's post.
    Practice makes perfect. I'm very far from perfect so I'm still practising.

  4. #4
    Registered User
    Join Date
    04-20-2014
    Location
    London
    MS-Off Ver
    Windows Excel 2010
    Posts
    79

    Re: NEED HELP! Code that copies row of data to another sheet based on text "Complete"/"Del

    12345678910
    Last edited by Dremzy; 04-23-2014 at 08:14 AM.

  5. #5
    Valued Forum Contributor
    Join Date
    07-04-2012
    Location
    Cape Town, RSA
    MS-Off Ver
    Office 365 ProPlus
    Posts
    1,050

    Re: NEED HELP! Code that copies row of data to another sheet based on text "Complete"/"Del

    Hi,

    See the sample workbook I sent.
    Each sheet (Sheet 1, 2, 3) has the same code in its Sheet_Change Event handler.
    To see the code, right click the sheet tab and select View Code.

    It does not of course reside on the Complete or Delete Sheets!

  6. #6
    Registered User
    Join Date
    04-20-2014
    Location
    London
    MS-Off Ver
    Windows Excel 2010
    Posts
    79

    Re: NEED HELP! Code that copies row of data to another sheet based on text "Complete"/"Del

    12345678910
    Last edited by Dremzy; 04-23-2014 at 08:14 AM.

  7. #7
    Valued Forum Contributor
    Join Date
    07-04-2012
    Location
    Cape Town, RSA
    MS-Off Ver
    Office 365 ProPlus
    Posts
    1,050

    Re: NEED HELP! Code that copies row of data to another sheet based on text "Complete"/"Del

    Hi,

    Try this...

    Please Login or Register  to view this content.

  8. #8
    Registered User
    Join Date
    04-20-2014
    Location
    London
    MS-Off Ver
    Windows Excel 2010
    Posts
    79

    Re: NEED HELP! Code that copies row of data to another sheet based on text "Complete"/"Del

    12345678910
    Last edited by Dremzy; 04-23-2014 at 08:15 AM.

  9. #9
    Registered User
    Join Date
    04-20-2014
    Location
    London
    MS-Off Ver
    Windows Excel 2010
    Posts
    79

    Re: NEED HELP! Code that copies row of data to another sheet based on text "Complete"/"Del

    12345678910
    Last edited by Dremzy; 04-23-2014 at 08:15 AM.

  10. #10
    Registered User
    Join Date
    04-20-2014
    Location
    London
    MS-Off Ver
    Windows Excel 2010
    Posts
    79

    Re: Code that copies row of data to another sheet based on text "Complete"/"Delete"

    Need help

  11. #11
    Valued Forum Contributor
    Join Date
    07-04-2012
    Location
    Cape Town, RSA
    MS-Off Ver
    Office 365 ProPlus
    Posts
    1,050

    Re: Code that copies row of data to another sheet based on text "Complete"/"Delete"

    Hi,

    Just have some guests over...
    I'll have a look into this when I get a moment

  12. #12
    Registered User
    Join Date
    04-20-2014
    Location
    London
    MS-Off Ver
    Windows Excel 2010
    Posts
    79

    Re: Code that copies row of data to another sheet based on text "Complete"/"Delete"

    12345678910
    Last edited by Dremzy; 04-23-2014 at 08:15 AM.

  13. #13
    Valued Forum Contributor
    Join Date
    07-04-2012
    Location
    Cape Town, RSA
    MS-Off Ver
    Office 365 ProPlus
    Posts
    1,050

    Re: Code that copies row of data to another sheet based on text "Complete"/"Delete"

    Hi,

    I cannot seem to simulate your error.
    Besides, it seems strange as the code is set to only trigger if specific conditions are met.

    If you are still having the issue, could you send the workbook to me as well as the steps that you are taking to cause the error. Then I can test and try identify the cause. If data is sensitive, just delete it or replace with dummy data.

    TX

  14. #14
    Registered User
    Join Date
    04-20-2014
    Location
    London
    MS-Off Ver
    Windows Excel 2010
    Posts
    79

    Re: Code that copies row of data to another sheet based on text "Complete"/"Delete"

    12345678910
    Attached Files Attached Files
    Last edited by Dremzy; 04-23-2014 at 08:15 AM.

  15. #15
    Valued Forum Contributor
    Join Date
    07-04-2012
    Location
    Cape Town, RSA
    MS-Off Ver
    Office 365 ProPlus
    Posts
    1,050

    Re: Code that copies row of data to another sheet based on text "Complete"/"Delete"

    Hi,

    I updated the event handlers to avoid the excessive prompting. See if it is working better now.
    Please check thoroughly.
    TX
    Attached Files Attached Files

  16. #16
    Registered User
    Join Date
    04-20-2014
    Location
    London
    MS-Off Ver
    Windows Excel 2010
    Posts
    79

    Re: Code that copies row of data to another sheet based on text "Complete"/"Delete"

    12345678910
    Last edited by Dremzy; 04-23-2014 at 08:12 AM.

  17. #17
    Registered User
    Join Date
    04-20-2014
    Location
    London
    MS-Off Ver
    Windows Excel 2010
    Posts
    79

    Re: Code that copies row of data to another sheet based on text "Complete"/"Delete"

    12345678910
    Last edited by Dremzy; 04-23-2014 at 08:12 AM.

  18. #18
    Valued Forum Contributor
    Join Date
    07-04-2012
    Location
    Cape Town, RSA
    MS-Off Ver
    Office 365 ProPlus
    Posts
    1,050

    Re: Code that copies row of data to another sheet based on text "Complete"/"Delete"

    Actually I didn't change much.
    I noticed that the code was triggering (as you said) when you copied data manually. This of course does change the intersected cell between column G and the target row, BUT the target cell (when you paste is in the A column, not the G column)

    I changed these lines from this:
    Please Login or Register  to view this content.
    To this:
    Please Login or Register  to view this content.
    When you paste the target has several cells, so the ".cells(1)" ensures that ONLY the cell intersecting Target and Column G is evaluated.

    Hope that makes sense.

+ 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: 2
    Last Post: 04-20-2014, 11:18 AM
  2. [SOLVED] Need help in fine tuning VBA code that copies row data to new sheet
    By naira in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-29-2013, 04:45 PM
  3. Replies: 14
    Last Post: 05-16-2013, 08:47 AM
  4. Replies: 2
    Last Post: 05-01-2013, 12:26 PM
  5. help. Search based on text input in a column selects a row and copies data.
    By ridermarangoni in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-27-2012, 10:53 AM

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