+ Reply to Thread
Results 1 to 25 of 25

Move entire row to another worksheet based on cell value

  1. #1
    bdf0827
    Guest

    Move entire row to another worksheet based on cell value

    Okay so here is what I'm looking at:


    I have an 'active pipeline' worksheet. Each row contains a potential lead. When I select 'Booked' I'd like that row to move to the 'Booked' worksheet. Also, when I select 'DNMQ' I'd like that row to move to the 'DNMQ' worksheet. I have tried for days to work out the coding for it and I just cant get anything to work. The cell that will contain 'Booked', DNMQ or other values will be in Column D. Please please help!
    Last edited by bdf0827; 09-04-2011 at 02:28 PM.

  2. #2
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Move entire row to another worksheet based on cell value

    bdf0827,

    Welcome to the Excel Forum.

    Sounds like you could use the Worksheet_Change Event in worksheet active pipeline.

    It sounds like you are using DataValidation in column D.

    Do you want the row to be copied to the correct worksheet? Or, copied to the correct worksheet, and then deleted from worksheet active pipeline?


    So that we can get it the first time can we have a sample workbook:

    To get the most precise answer, it is best to upload/attach a sample workbook (sensitive data scrubbed/removed/changed) that contains an example of your raw data on one worksheet, and on another worksheet your desired results.

    The structure and data types of the sample workbook must exactly duplicate the real workbook. Include a clear and explicit explanation of your requirements.

    To attach your workbook, click on the New Post button, then scroll down and click on the Go Advanced button, then scroll down and click on the Manage Attachments button.
    Have a great day,
    Stan

    Windows 10, Excel 2007, on a PC.

    If you are satisfied with the solution(s) provided, please mark your thread as Solved by clicking EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

  3. #3
    Valued Forum Contributor gjlindn's Avatar
    Join Date
    08-01-2011
    Location
    Dodgeville, WI
    MS-Off Ver
    Excel 2003, 2007, 2010, 2013
    Posts
    369

    Re: Move entire row to another worksheet based on cell value

    Sorry...I think you're going to need to post your code and/or a sample workbook. Thanks!
    -Greg If this is helpful, pls click Star icon in lower left corner

  4. #4
    bdf0827
    Guest

    Re: Move entire row to another worksheet based on cell value

    I would like them to be moved to the other worksheet and then be deleted from the current pipeline. When they are added to the booked or dnmq workbook, can we have them be automatically placed on the next open row?

    Basically if I select Booked then they will move to booked worksheet on the next free row.
    If i select DNMQ then they will move to DNMQ worksheet on the next free row.

    Hope this helps and thanks for your help!
    Attached Files Attached Files

  5. #5
    Valued Forum Contributor gjlindn's Avatar
    Join Date
    08-01-2011
    Location
    Dodgeville, WI
    MS-Off Ver
    Excel 2003, 2007, 2010, 2013
    Posts
    369

    Re: Move entire row to another worksheet based on cell value

    This would go in your Current worksheet module. If you need the rows on the Current sheet moved up, you'll need additional code.
    Please Login or Register  to view this content.
    Good luck!

  6. #6
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Move entire row to another worksheet based on cell value

    bdf0827,

    Thanks for the workbook.


    Detach/open workbook Worksheet_Change Event wC colD wB wD bdf0827 - EF790860 - SDG12.xlsm and make changes to the DataValidation cells in worksheet Current in range D7:D26.

    Then check the other two worksheets.



    If you want to use the macro on another workbook:


    Please TEST this FIRST in a COPY of your workbook (always make a backup copy before trying new code, you never know what you might lose).

    1. Copy the below code, by highlighting the code and pressing the keys CTRL + C
    2. Select the worksheet in which your code is to run, worksheet Current
    3. Right click on the sheet tab and choose View Code, to open the Visual Basic Editor
    4. Where the cursor is flashing, paste the code by pressing the keys CTRL + V
    5. Press the keys ALT + Q to exit the Editor, and return to Excel


    Please Login or Register  to view this content.

    Before you use the macro with Excel 2007 or newer, save your workbook, Save As, a macro enabled workbook with the file extension .xlsm

    Then make changes to the DataValidation cells in worksheet Current in range D7:D26.

    Then check the other two worksheets.
    Last edited by stanleydgromjr; 09-03-2011 at 11:03 PM.

  7. #7
    bdf0827
    Guest

    Re: Move entire row to another worksheet based on cell value

    Thanks for your help. Is there a way to have once the status gets changed to booked or dnmq for it to delete from the current pipeline sheet? It moves over perfectly!


    Quote Originally Posted by stanleydgromjr View Post
    bdf0827,

    Thanks for the workbook.


    Detach/open workbook Worksheet_Change Event wC colD wB wD bdf0827 - EF790860 - SDG12.xlsm and make changes to the DataValidation cells in worksheet Current in range D7:D26.

    Then check the other two worksheets.



    If you want to use the macro on another workbook:


    Please TEST this FIRST in a COPY of your workbook (always make a backup copy before trying new code, you never know what you might lose).

    1. Copy the below code, by highlighting the code and pressing the keys CTRL + C
    2. Select the worksheet in which your code is to run, worksheet Current
    3. Right click on the sheet tab and choose View Code, to open the Visual Basic Editor
    4. Where the cursor is flashing, paste the code by pressing the keys CTRL + V
    5. Press the keys ALT + Q to exit the Editor, and return to Excel


    Please Login or Register  to view this content.

    Before you use the macro with Excel 2007 or newer, save your workbook, Save As, a macro enabled workbook with the file extension .xlsm

    Then make changes to the DataValidation cells in worksheet Current in range D7:D26.

    Then check the other two worksheets.

  8. #8
    bdf0827
    Guest

    Talking Re: Move entire row to another worksheet based on cell value

    Oh and I forgot also, do you know if once it deletes from the current pipeline worksheet if the rows can be moved up so there is no blank row?


    Quote Originally Posted by stanleydgromjr View Post
    bdf0827,

    Thanks for the workbook.


    Detach/open workbook Worksheet_Change Event wC colD wB wD bdf0827 - EF790860 - SDG12.xlsm and make changes to the DataValidation cells in worksheet Current in range D7:D26.

    Then check the other two worksheets.



    If you want to use the macro on another workbook:


    Please TEST this FIRST in a COPY of your workbook (always make a backup copy before trying new code, you never know what you might lose).

    1. Copy the below code, by highlighting the code and pressing the keys CTRL + C
    2. Select the worksheet in which your code is to run, worksheet Current
    3. Right click on the sheet tab and choose View Code, to open the Visual Basic Editor
    4. Where the cursor is flashing, paste the code by pressing the keys CTRL + V
    5. Press the keys ALT + Q to exit the Editor, and return to Excel


    Please Login or Register  to view this content.

    Before you use the macro with Excel 2007 or newer, save your workbook, Save As, a macro enabled workbook with the file extension .xlsm

    Then make changes to the DataValidation cells in worksheet Current in range D7:D26.

    Then check the other two worksheets.

  9. #9
    Valued Forum Contributor gjlindn's Avatar
    Join Date
    08-01-2011
    Location
    Dodgeville, WI
    MS-Off Ver
    Excel 2003, 2007, 2010, 2013
    Posts
    369

    Re: Move entire row to another worksheet based on cell value

    Rolls data up to fill empty row
    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by gjlindn; 09-04-2011 at 12:05 AM.

  10. #10
    bdf0827
    Guest

    Re: Move entire row to another worksheet based on cell value

    Works perfectly, thank you a million times for your help!!!!


    Quote Originally Posted by stanleydgromjr View Post
    bdf0827,

    Thanks for the workbook.


    Detach/open workbook Worksheet_Change Event wC colD wB wD bdf0827 - EF790860 - SDG12.xlsm and make changes to the DataValidation cells in worksheet Current in range D7:D26.

    Then check the other two worksheets.



    If you want to use the macro on another workbook:


    Please TEST this FIRST in a COPY of your workbook (always make a backup copy before trying new code, you never know what you might lose).

    1. Copy the below code, by highlighting the code and pressing the keys CTRL + C
    2. Select the worksheet in which your code is to run, worksheet Current
    3. Right click on the sheet tab and choose View Code, to open the Visual Basic Editor
    4. Where the cursor is flashing, paste the code by pressing the keys CTRL + V
    5. Press the keys ALT + Q to exit the Editor, and return to Excel


    Please Login or Register  to view this content.

    Before you use the macro with Excel 2007 or newer, save your workbook, Save As, a macro enabled workbook with the file extension .xlsm

    Then make changes to the DataValidation cells in worksheet Current in range D7:D26.

    Then check the other two worksheets.
    Quote Originally Posted by gjlindn View Post
    Rolls data up to fill empty row
    Please Login or Register  to view this content.

  11. #11
    bdf0827
    Guest

    Re: Move entire row to another worksheet based on cell value

    I'm trying to figure out how to mark this as solved. I've tried clicking all around.

  12. #12
    Valued Forum Contributor gjlindn's Avatar
    Join Date
    08-01-2011
    Location
    Dodgeville, WI
    MS-Off Ver
    Excel 2003, 2007, 2010, 2013
    Posts
    369

    Re: Move entire row to another worksheet based on cell value

    Formula updates.
    Attached Files Attached Files

  13. #13
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Move entire row to another worksheet based on cell value

    bdf0827,

    Per your latest request "after copying the Target.Row, delete the Target.Row".


    Please TEST this FIRST in a COPY of your workbook (always make a backup copy before trying new code, you never know what you might lose).

    1. Copy the below code, by highlighting the code and pressing the keys CTRL + C
    2. Select the worksheet in which your code is to run, worksheet Current
    3. Right click on the sheet tab and choose View Code, to open the Visual Basic Editor
    4. Where the cursor is flashing, paste the code by pressing the keys CTRL + V
    5. Press the keys ALT + Q to exit the Editor, and return to Excel


    Please Login or Register  to view this content.

    If you are satisfied with the solution(s) provided, please mark your thread as Solved by clicking EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.

  14. #14
    bdf0827
    Guest

    Re: Move entire row to another worksheet based on cell value

    The minor changes somehow messed up the coding and I don't know which item did it.

    Quote Originally Posted by gjlindn View Post
    Formula updates.
    Attached Files Attached Files

  15. #15
    bdf0827
    Guest

    Re: Move entire row to another worksheet based on cell value

    The DNMQ works fine, but the booked moves them below the totals for some reason. Any ideas?



    Quote Originally Posted by stanleydgromjr View Post
    bdf0827,

    Per your latest request "after copying the Target.Row, delete the Target.Row".


    Please TEST this FIRST in a COPY of your workbook (always make a backup copy before trying new code, you never know what you might lose).

    1. Copy the below code, by highlighting the code and pressing the keys CTRL + C
    2. Select the worksheet in which your code is to run, worksheet Current
    3. Right click on the sheet tab and choose View Code, to open the Visual Basic Editor
    4. Where the cursor is flashing, paste the code by pressing the keys CTRL + V
    5. Press the keys ALT + Q to exit the Editor, and return to Excel


    Please Login or Register  to view this content.

    If you are satisfied with the solution(s) provided, please mark your thread as Solved by clicking EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.
    Attached Files Attached Files

  16. #16
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Move entire row to another worksheet based on cell value

    bdf0827,


    Please do not click on the Quote message in reply? button/box when replying.


    It makes it difficult trying to determine what you are asking for, and to whom you are replying.


    The reason that the macros are not working correctly is beacuse the Total line in worksheets Booked and DNMQ is NOT in a constant row.


    The following macro looks for the row that the text Potential is in, in the two receiving worksheets, and then determines the next available row in column D that is blank.


    Please TEST this FIRST in a COPY of your workbook (always make a backup copy before trying new code, you never know what you might lose).

    1. Copy the below code, by highlighting the code and pressing the keys CTRL + C
    2. Select the worksheet in which your code is to run, worksheet Current

    3. Right click on the sheet tab and choose View Code, to open the Visual Basic Editor
    4. Where the cursor is flashing, paste the code by pressing the keys CTRL + V
    5. Press the keys ALT + Q to exit the Editor, and return to Excel


    Please Login or Register  to view this content.

  17. #17
    Registered User
    Join Date
    09-27-2011
    Location
    Midlands
    MS-Off Ver
    Excel 2003
    Posts
    1

    Re: Move entire row to another worksheet based on cell value

    Can someone please help before I lose my sanity.

    I have the following code which works perfectly, but how do I extend it to move items marked "O" to the "Ordered" worksheet?

    Private Sub Worksheet_Change(ByVal Target As Range)
    Application.EnableEvents = False

    On Error GoTo ErrHnd

    If Target.Column = 12 And UCase(Target.Text) = "D" Then
    Dim rngCell As Range
    Dim rngDest As Range
    Dim strRowAddr As String


    strRowAddr = Target.Address


    Set rngDest = Worksheets("Dead"). _
    Range("A" & CStr(Application.Rows.Count)).End(xlUp).Offset(1, 0)


    Target.EntireRow.Cut Destination:=rngDest

    Application.CutCopyMode = False

    Worksheets("Input Sheet").Range(strRowAddr).EntireRow.Delete _
    Shift:=xlUp
    End If
    Application.EnableEvents = True
    Exit Sub


    ErrHnd:
    Err.Clear
    Application.EnableEvents = True
    End Sub

  18. #18
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Move entire row to another worksheet based on cell value

    bdf0827,

    It would really make it easier if you did not quote your helpers entire post - it is hard to follow what is being requested.


    Your worksheets Booked and DNMQ have their TOTAL row in a different position.


    The below macro will work correctly until all the enpty rows in column D, between Status and Potential have all been used up.



    Please TEST this FIRST in a COPY of your workbook (always make a backup copy before trying new code, you never know what you might lose).

    1. Copy the below code, by highlighting the code and pressing the keys CTRL + C
    2. Select the worksheet in which your code is to run, worksheet Current
    3. Right click on the sheet tab and choose View Code, to open the Visual Basic Editor
    4. Where the cursor is flashing, paste the code by pressing the keys CTRL + V
    5. Press the keys ALT + Q to exit the Editor, and return to Excel


    Please Login or Register  to view this content.

    Then make changes in worksheet Current, column D.

  19. #19
    Registered User
    Join Date
    09-11-2012
    Location
    United States
    MS-Off Ver
    Excel 2003
    Posts
    10

    Re: Move entire row to another worksheet based on cell value

    Intern Master List2.xlsmI am trying to do something very similar and I am following all the steps and it's not working. I have attached my spreadsheet. I already have the drop down lists done in tab "Non Tech", but basically if someone selects "NO" from Column G or Column K, I want that row to be removed from the "Non Tech" tab and pasted in the "Rejected" tab. Can someone please give me the code for this?

    Thanks!!!!!!!!

  20. #20
    Forum Expert
    Join Date
    10-10-2008
    Location
    Northeast Pennsylvania, USA
    MS-Off Ver
    Excel 2007
    Posts
    2,387

    Re: Move entire row to another worksheet based on cell value

    cbesinger,

    Please do not post your questions in threads started by others - - this is known as thread hijacking.

    Always start a New Post for your questions and, if you think it helps, provide a link to any other thread as a reference.

    Start a New Post for your question and be sure to give it a search friendly title that accurately describes your need.

  21. #21
    Registered User
    Join Date
    09-12-2012
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    8

    Red face Re: Move entire row to another worksheet based on cell value

    Hi,
    I have have a similar issue as to this one above, and would like to know how you solved this..

    I have a spreadsheet to record outstanding orders in a MAIN sheet, once a order is "placed", I'd like that row to move to the sheet called eg."AB Suppliers" and be deleted out of the main sheet. Further more I have an "RECON AB Suppliers" sheet, everything that is placed in "AB Suppliers" will calculated per month end due in the "RECON AB Suppliers" sheet..
    Therefore, I can add new sales in the MAIN sheet, and just select "placed" when done, and everything else will be in place, and at the end of the month I can see what I placed with AB Suppliers and what is due for that specific month...

    I need help on making this sheet happen ... I understand excel and formulas very well, have not experimented with Macro or VBA before...


  22. #22
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Move entire row to another worksheet based on cell value

    Berndene,

    As told to cbesinger above,

    Welcome to the Forum, unfortunately:

    Your post does not comply with Rule 2 of our Forum RULES. Don't post a question in the thread of another member -- start your own thread. If you feel it's particularly relevant, provide a link to the other thread. It makes sense to have a new thread for your question because a thread with numerous replies can be off putting & difficult to pick out relevant replies.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  23. #23
    Registered User
    Join Date
    09-12-2012
    Location
    South Africa
    MS-Off Ver
    Excel 2010
    Posts
    8

    Re: Move entire row to another worksheet based on cell value

    Hi Arlette,

    Sorry bout that,

    How do I create a new thread?

  24. #24
    Registered User
    Join Date
    11-09-2013
    Location
    Hong Kong
    MS-Off Ver
    Excel 2011
    Posts
    7

    Re: Move entire row to another worksheet based on cell value

    I would appreciate some help on the same topic.
    I would like to move rows that have been marked as In-Active (column 14) to a new sheet called "Archive"
    Tried to copy the code into the sheet but have some problems in getting it to work.
    Please have a look at the attached file.

    Thank you!
    Attached Files Attached Files

  25. #25
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Move entire row to another worksheet based on cell value

    wellie31,

    Welcome to the forum. Please check post 22.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

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