+ Reply to Thread
Results 1 to 14 of 14

Highlight row & automatically move it to bottom of spreadsheet once completed date entered

  1. #1
    Registered User
    Join Date
    06-10-2015
    Location
    United States
    MS-Off Ver
    2010
    Posts
    8

    Highlight row & automatically move it to bottom of spreadsheet once completed date entered

    Hi,

    I'm trying to figure out the conditional formatting to highlight a row and automatically move it to the bottom of the spreadsheet once a date is entered in the completed column. Can anyone help with this?

    Thanks,

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

    Re: Highlight row & automatically move it to bottom of spreadsheet once completed date ent

    Not CF, but event code. Say that the date completed column is column J, and that all the columns from A to I are filled.

    1) Copy this code.
    2) Right-Click the sheet tab of interest.
    3) Select "View Code"
    4) Paste the code into the window that appears.
    5) Save the file as a macro-enabled .xlsm file.
    6) Make changes to the J:J to reflect the column of dates actually used

    Then when a value is entered into a single cell in that column, the entire row will be moved to the bottom of the list, based on entries in column A.


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

  3. #3
    Registered User
    Join Date
    06-10-2015
    Location
    United States
    MS-Off Ver
    2010
    Posts
    8

    Re: Highlight row & automatically move it to bottom of spreadsheet once completed date ent

    Hm it doesn't seem to be working. My completed column is G and I changed that. Not all cells in the row will necessarily be filled some may be blank. I just want a row to be moved to the bottom of the worksheet once a date is put into the completed column.

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

    Re: Highlight row & automatically move it to bottom of spreadsheet once completed date ent

    Post a sanitized version of your workbook with comments, and I will take a look.

    You could also try to change the "A" in the this line:

    Target.EntireRow.Copy Cells(Rows.Count, "A").End(xlUp)(2).EntireRow

    to a column that you know will have values - say, D:

    Target.EntireRow.Copy Cells(Rows.Count, "D").End(xlUp)(2).EntireRow
    Last edited by Bernie Deitrick; 01-22-2016 at 10:06 AM.

  5. #5
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Highlight row & automatically move it to bottom of spreadsheet once completed date ent

    Did you make the changes? Are there values in Column A? The code should work.

  6. #6
    Registered User
    Join Date
    06-10-2015
    Location
    United States
    MS-Off Ver
    2010
    Posts
    8

    Re: Highlight row & automatically move it to bottom of spreadsheet once completed date ent

    Hi,

    This is the code I used:

    Private Sub Worksheet_Change(ByVal Target As Range)

    If Target.Cells.Count > 1 Then Exit Sub
    If Target.Value = "" Then Exit Sub
    If Intersect(Target, Range("G:G")) Is Nothing Then Exit Sub

    Application.EnableEvents = False
    Target.EntireRow.Copy Cells(Rows.Count, "G").End(xlUp)(2).EntireRow
    Target.EntireRow.Delete
    Application.EnableEvents = True
    End Sub

    I changed the J and the A to G since that column is where the completed date is entered and thats when it should move to the bottom. When I tried it, it somewhat worked. The row did move towards the bottom but it deleted another row and moved in place of that and it continued to do that whenever i entered a date into the completed column.

  7. #7
    Registered User
    Join Date
    06-10-2015
    Location
    United States
    MS-Off Ver
    2010
    Posts
    8

    Re: Highlight row & automatically move it to bottom of spreadsheet once completed date ent

    I've attached a generic version of my spreadsheet below
    Attached Files Attached Files

  8. #8
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Highlight row & automatically move it to bottom of spreadsheet once completed date ent

    You made changes too the suggested code. This works for me on your sample.

    Please Login or Register  to view this content.
    BTW. You cannot paste an entirerow to anywhere except Column "A"
    Last edited by JOHN H. DAVIS; 01-25-2016 at 02:46 PM.

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

    Re: Highlight row & automatically move it to bottom of spreadsheet once completed date ent

    The column needs to be a filled in column, where the bottom is apparent. That is why G will not work to determine the last row - my original code looked at A, and since A is filled, you should use

    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    06-10-2015
    Location
    United States
    MS-Off Ver
    2010
    Posts
    8

    Re: Highlight row & automatically move it to bottom of spreadsheet once completed date ent

    Hi,

    Thanks so much for your help on this again. Is there a way to conditionally format the worksheet where when the completed date is entered, it moves to the bottom of the worksheet and the row is also highlight in a light gray? I've tried formatting it a couple of different ways but i can't get the right formula.

    Thanks,

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

    Re: Highlight row & automatically move it to bottom of spreadsheet once completed date ent

    You can record a macro to get the exact shade of color you want, but this will get you started.

    Please Login or Register  to view this content.

  12. #12
    Registered User
    Join Date
    06-10-2015
    Location
    United States
    MS-Off Ver
    2010
    Posts
    8

    Re: Highlight row & automatically move it to bottom of spreadsheet once completed date ent

    I actually found a similar code on another thread in this forum and tried it but the attached error came up. Same thing happened when i used the code you just gave me. Thanks
    Attached Images Attached Images

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

    Re: Highlight row & automatically move it to bottom of spreadsheet once completed date ent

    You can only have one of those macros in the module at a time - delete all but the new code that I posted.

  14. #14
    Registered User
    Join Date
    06-10-2015
    Location
    United States
    MS-Off Ver
    2010
    Posts
    8

    Re: Highlight row & automatically move it to bottom of spreadsheet once completed date ent

    Thank you!!

+ 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: 1
    Last Post: 01-21-2016, 03:34 PM
  2. Move entire row of data from Sheet 1 to sheet 2 when completed date is entered.
    By jt7721 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 05-18-2013, 11:50 AM
  3. [SOLVED] I want to have the date entered in cell O3 when Completed is chosen
    By bouncingbudha in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 04-01-2013, 04:06 PM
  4. [SOLVED] Auto highlight cells in a column and move it to the bottom of another cell with a macro?
    By L2012 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-01-2012, 07:44 AM
  5. [SOLVED] Move completed rows to another sheet, and parts need to the bottom sheet.
    By sherryp5165 in forum Excel Programming / VBA / Macros
    Replies: 31
    Last Post: 08-24-2012, 05:34 PM
  6. Moving completed cells to top and incomplete to bottom automatically
    By goose1000 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 07-13-2011, 05:38 PM
  7. Replies: 1
    Last Post: 01-11-2009, 09:39 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