+ Reply to Thread
Results 1 to 26 of 26

moving row to new sheet when conditions are met

  1. #1
    Registered User
    Join Date
    10-12-2012
    Location
    Philadelphia, Pa
    MS-Off Ver
    Excel 2007
    Posts
    72

    moving row to new sheet when conditions are met

    I had a similar thread and that issue was solved quickly. so hopefully this an too.

    I have columns:

    (Issue#) (Complaint) (Bid #) (Po#) ( Dept) (Contact) (Vendor) (Received)

    (Resolved) (Completed)

    I need it when i input yes under completed, it moves that whole a sheet labeled with the corresponding Dept. So if under Dept it said "water" and i marked it yes for completed, it would move that row to a sheet labeled.

    If you could give me the code to do that, maybe i can figure out how to add the other dept names i deal with. Thanks in advance.

    this is for excel 2007
    Last edited by CityInspector; 10-19-2012 at 08:51 AM.

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

    Re: moving row to new sheet when conditions are met

    Will the dept be selected by a dropdown or will the values be entered?

    Do you want the movement to happen instantly or will you select the status for each row and then click on a button?
    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]

  3. #3
    Registered User
    Join Date
    10-12-2012
    Location
    Philadelphia, Pa
    MS-Off Ver
    Excel 2007
    Posts
    72

    Re: moving row to new sheet when conditions are met

    I would like to use drop down menus, but can input the value if that is easier

    and I want it to run when I use the a drop down menu in the "Completed" coloumn and select "yes".
    Last edited by Cutter; 10-18-2012 at 05:19 PM. Reason: Removed whole post quote

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

    Re: moving row to new sheet when conditions are met

    Based on the columns stated in the 1st post, its not clear as to how many columns you have and which is the completed column.

    Do you have 9 columns in total and completed is column 9 (column I)?

  5. #5
    Registered User
    Join Date
    10-12-2012
    Location
    Philadelphia, Pa
    MS-Off Ver
    Excel 2007
    Posts
    72

    Re: moving row to new sheet when conditions are met

    I edited the first post to help. I put parenthesis around each column name. There is ten in total.
    Last edited by Cutter; 10-18-2012 at 05:19 PM. Reason: Removed whole post quote

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

    Re: moving row to new sheet when conditions are met

    Right click on the sheet containing the data and paste this code in -
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    10-12-2012
    Location
    Philadelphia, Pa
    MS-Off Ver
    Excel 2007
    Posts
    72

    Re: moving row to new sheet when conditions are met

    I pasted the code into the Visual Basic but when i picked yes in column J nothing happened
    Last edited by arlu1201; 10-19-2012 at 08:16 AM. Reason: Do not quote whole posts.

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

    Re: moving row to new sheet when conditions are met

    Was it "yes" in the dropdown or "Yes" ?

  9. #9
    Registered User
    Join Date
    10-12-2012
    Location
    Philadelphia, Pa
    MS-Off Ver
    Excel 2007
    Posts
    72

    Re: moving row to new sheet when conditions are met

    Quote Originally Posted by arlu1201 View Post
    Was it "yes" in the dropdown or "Yes" ?

    yes in the drop down

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

    Re: moving row to new sheet when conditions are met

    Change this row
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.

  11. #11
    Registered User
    Join Date
    10-12-2012
    Location
    Philadelphia, Pa
    MS-Off Ver
    Excel 2007
    Posts
    72

    Re: moving row to new sheet when conditions are met

    Quote Originally Posted by arlu1201 View Post
    Change this row
    Please Login or Register  to view this content.
    to
    Please Login or Register  to view this content.

    Got it to work. I select yes from drop down list and then i have to click on the cell containing the "Dept" name and then it moves it to new sheet. Is there a way to have it move when i select yes?
    Last edited by CityInspector; 10-19-2012 at 08:41 AM.

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

    Re: moving row to new sheet when conditions are met

    You have to select the dept first and then yes. It will move then.

  13. #13
    Registered User
    Join Date
    10-12-2012
    Location
    Philadelphia, Pa
    MS-Off Ver
    Excel 2007
    Posts
    72

    Re: moving row to new sheet when conditions are met

    Got it. Thanks for all your help. I have another thread with a hyperlink question. Any help with that would be great.

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

    Re: moving row to new sheet when conditions are met

    Am glad it worked. I will look into it and see what i can do.

  15. #15
    Registered User
    Join Date
    10-12-2012
    Location
    Philadelphia, Pa
    MS-Off Ver
    Excel 2007
    Posts
    72

    Re: moving row to new sheet when conditions are met

    If I wanted to change it so instead of putting yes in the cell to have it run the macro, I would input a date and it would then move the row to a new sheet.

    What would I change in this code:

    If Range("J" & Target.Row).Value = "yes" Then

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

    Re: moving row to new sheet when conditions are met

    Is it a fixed date?

  17. #17
    Registered User
    Join Date
    10-12-2012
    Location
    Philadelphia, Pa
    MS-Off Ver
    Excel 2007
    Posts
    72

    Re: moving row to new sheet when conditions are met

    Not sure i know what you mean. i want to be able to type in a date and when i press enter i want it to move to the sheet based on what dept is listed. Pretty much what you wrote for me before but get rid of the "yes" drop down and have it so when I type the date and hit enter it does the move.

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

    Re: moving row to new sheet when conditions are met

    Change it to
    Please Login or Register  to view this content.

  19. #19
    Registered User
    Join Date
    10-12-2012
    Location
    Philadelphia, Pa
    MS-Off Ver
    Excel 2007
    Posts
    72

    Re: moving row to new sheet when conditions are met

    Did that but nothing happens when I enter the date

  20. #20
    Registered User
    Join Date
    10-12-2012
    Location
    Philadelphia, Pa
    MS-Off Ver
    Excel 2007
    Posts
    72

    Re: moving row to new sheet when conditions are met

    Please Login or Register  to view this content.
    This what I have now. I did change the "J" to and "I" cause I didn't need that many columns

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

    Re: moving row to new sheet when conditions are met

    The code is fine. It doesnt copy the data to the next sheet?

  22. #22
    Registered User
    Join Date
    10-12-2012
    Location
    Philadelphia, Pa
    MS-Off Ver
    Excel 2007
    Posts
    72

    Re: moving row to new sheet when conditions are met

    I got it to copy it to a new sheet but i have to type date, hit enter, then go back and click the dept again. Is there a way to do it so when i hit enter after typing the date it will move the row?
    Last edited by CityInspector; 10-22-2012 at 03:04 PM. Reason: got it working, kinda

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

    Re: moving row to new sheet when conditions are met

    It will be good if you attach a sample file then so i can check.

  24. #24
    Registered User
    Join Date
    10-12-2012
    Location
    Philadelphia, Pa
    MS-Off Ver
    Excel 2007
    Posts
    72

    Re: moving row to new sheet when conditions are met

    here you go
    Last edited by CityInspector; 10-22-2012 at 03:28 PM.

  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: moving row to new sheet when conditions are met

    Try this (since you do not have a dropdown anymore)
    Please Login or Register  to view this content.

  26. #26
    Registered User
    Join Date
    10-12-2012
    Location
    Philadelphia, Pa
    MS-Off Ver
    Excel 2007
    Posts
    72

    Re: moving row to new sheet when conditions are met

    That worked. Thanks for helping out. I really appreciate it.

+ 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