+ Reply to Thread
Results 1 to 15 of 15

Move entire row to the bottom if cell has value.

  1. #1
    Registered User
    Join Date
    02-22-2019
    Location
    Michigan, USA
    MS-Off Ver
    MS 2010
    Posts
    49

    Move entire row to the bottom if cell has value.

    Greetings,

    I have an ongoing database and would like to be able to move all the rows with a date to the bottom of the spreadsheet and the rows without a date to the top. The date is in column H. Below is the code I am currently trying to preform the necessary task. Any help is much appreciated.

    Please Login or Register  to view this content.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Move entire row to the bottom if cell has value.

    Your code is testing for the word "Date" and not an actual serial date.

    This would test for a serial date if that's what you want.

    Please Login or Register  to view this content.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Registered User
    Join Date
    02-22-2019
    Location
    Michigan, USA
    MS-Off Ver
    MS 2010
    Posts
    49

    Re: Move entire row to the bottom if cell has value.

    I made the changes but it only moves the first row to the bottom. I would like the code to move every row with a date in column H to the bottom

  4. #4
    Registered User
    Join Date
    02-22-2019
    Location
    Michigan, USA
    MS-Off Ver
    MS 2010
    Posts
    49

    Re: Move entire row to the bottom if cell has value.

    I have attempted a few solutions but to no avail. Does anyone know what I am missing for every row with a date in column H to be moved to the bottom of the worksheet?

  5. #5
    Forum Expert
    Join Date
    12-24-2007
    Location
    Alsace - France
    MS-Off Ver
    MS 365 Office Suite
    Posts
    5,066

    Re: Move entire row to the bottom if cell has value.

    It will be nice to attach an Excel sample to avoid confusion, can you do it?
    - Battle without fear gives no glory - Just try

  6. #6
    Registered User
    Join Date
    02-22-2019
    Location
    Michigan, USA
    MS-Off Ver
    MS 2010
    Posts
    49

    Re: Move entire row to the bottom if cell has value.

    Attached is an example worksheet. In the Date Complete column I would like all the rows with a date complete to be at the bottom and ones without to be at the top of the worksheet.
    Attached Files Attached Files

  7. #7
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,526

    Re: Move entire row to the bottom if cell has value.

    If it is possible, sort your Data from low to high (A to Z).
    Of course the cells that look empty need to be empty.

  8. #8
    Forum Expert
    Join Date
    11-24-2013
    Location
    Paris, France
    MS-Off Ver
    Excel 2003 / 2010
    Posts
    9,831

    Cool Hi ! Try this !


    As a beginner starter, paste this demonstration to the (Sheet1) worksheet module :

    PHP Code: 
    Sub Demo1()
             
    Application.ScreenUpdating False
        With Range
    ("A8:A" Me.UsedRange.Rows.Count).Resize(, Me.UsedRange.Columns.Count 1).Columns
            
    .Item(.Count).Value2 Me.Evaluate(.Item(8).Address ">""""")
            .
    Sort .Cells(.Count), xlAscendingHeader:=xlNo
            
    .Item(.Count).ClearContents
        End With
             Application
    .ScreenUpdating True
    End Sub 
    Do you like it ? So thanks to click on bottom left star icon « Add Reputation » !

  9. #9
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: Move entire row to the bottom if cell has value.

    Please Login or Register  to view this content.

  10. #10
    Registered User
    Join Date
    02-22-2019
    Location
    Michigan, USA
    MS-Off Ver
    MS 2010
    Posts
    49

    Re: Move entire row to the bottom if cell has value.

    This works great is there a way to have the code run every time the date is changed using a userform. I tried inserting the code into the userform code shown below but that didn't do what I needed. I am trying to have the code automatically move that row of data to the bottom every time a tech fills out the date complete on the userform. Thanks for all the help I hope this isn't impossible.

    Please Login or Register  to view this content.

  11. #11
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,286

    Re: Move entire row to the bottom if cell has value.

    If the userform changes the value of the cells H on the worksheet use a worksheet change event to trigger the code you have

    Please Login or Register  to view this content.

  12. #12
    Registered User
    Join Date
    02-22-2019
    Location
    Michigan, USA
    MS-Off Ver
    MS 2010
    Posts
    49

    Re: Move entire row to the bottom if cell has value.

    I cant figure out where to put the line of code. Attached is a reduced version of my database with names and such removed. The worksheets are locked (pass: abc) and the userforms on the SOL page is used to fill the worksheets. The 'Look Up Order' userform is used to fill in the complete date on both SOL and Tool Room Sheet. On the tool room sheet I would like the rows sorted by if it has a date complete or not with the ones without a date on top. I do not want the data on the SOL sheet changed, which right now it is changing both. Any help would be greatly appreciated and thank you all for your continuing help.
    Attached Files Attached Files

  13. #13
    Registered User
    Join Date
    02-22-2019
    Location
    Michigan, USA
    MS-Off Ver
    MS 2010
    Posts
    49

    Re: Move entire row to the bottom if cell has value.

    I have posted one

  14. #14
    Forum Expert nigelog's Avatar
    Join Date
    12-14-2007
    Location
    Cork, Ireland
    MS-Off Ver
    Office 365 Windows 10
    Posts
    2,286

    Re: Move entire row to the bottom if cell has value.

    Password given does not open vba editor so cannot be tested

    code removed
    Last edited by nigelog; 10-29-2019 at 10:05 AM.

  15. #15
    Registered User
    Join Date
    02-22-2019
    Location
    Michigan, USA
    MS-Off Ver
    MS 2010
    Posts
    49

    Re: Move entire row to the bottom if cell has value.

    My apologies the password is "help" for the VBA code

+ 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. Enter Bottom Row Border in entire row if a cell has text
    By Thanks4helping in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-15-2016, 03:52 PM
  2. [SOLVED] Need to move row to bottom of another worksheet based on cell criteria
    By amymsellers in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 03-30-2016, 09:49 PM
  3. Move first cell to bottom and Shift others up one cell
    By ghashgul in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-14-2014, 11:24 PM
  4. row does not move to bottom of list when cell is populated with date
    By marrco45 in forum Excel - New Users/Basics
    Replies: 4
    Last Post: 03-01-2014, 08:47 AM
  5. [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
  6. If cell contains value, move entire row WAY down
    By wnstar21 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-20-2009, 10:52 AM
  7. Shortcut to move to bottom (last) cell in a column
    By Frustrated in forum Excel General
    Replies: 1
    Last Post: 09-20-2005, 11:05 PM

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