+ Reply to Thread
Results 1 to 10 of 10

Update the code so the ''Completed'' events seem at the top of the bottom list

  1. #1
    Registered User
    Join Date
    11-24-2022
    Location
    Istanbul, Turkey
    MS-Off Ver
    Excel 2019
    Posts
    36

    Exclamation Update the code so the ''Completed'' events seem at the top of the bottom list

    I have a file where ''completed'' events move to the bottom of the list by the help of a code. I need the last ''Completed'' event to end at the top of the ''Completed'' events list and not the bottom. Any help would be much appreciated. The example is in the file attached.
    Attached Files Attached Files
    Last edited by ramilh; 11-25-2022 at 01:13 AM.

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,624

    Re: Update the code so the ''Completed'' events seem at the top of the bottom list

    Example.xlsm: So very sad
    Ben Van Johnson

  3. #3
    Registered User
    Join Date
    11-24-2022
    Location
    Istanbul, Turkey
    MS-Off Ver
    Excel 2019
    Posts
    36

    Re: Update the code so the ''Completed'' events seem at the top of the bottom list

    It is more sad to comment on this post without being of any help.

  4. #4
    Valued Forum Contributor
    Join Date
    08-08-2022
    Location
    Buenos Aires
    MS-Off Ver
    Excel 2019
    Posts
    1,777

    Re: Update the code so the ''Completed'' events seem at the top of the bottom list

    Hello Ramilh. Try with:

    Please Login or Register  to view this content.
    You are always very welcome if you add reputation by clicking the * (bottom left) of each message that has helped you.

  5. #5
    Forum Expert
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    O365 32bit (Windows)
    Posts
    2,035

    Re: Update the code so the ''Completed'' events seem at the top of the bottom list

    Does this work for you?

    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    11-24-2022
    Location
    Istanbul, Turkey
    MS-Off Ver
    Excel 2019
    Posts
    36

    Re: Update the code so the ''Completed'' events seem at the top of the bottom list

    Thanks a lot, ByteMarks! Works perfectly even after I add extra rows after the code.

  7. #7
    Forum Expert
    Join Date
    07-23-2018
    Location
    UK
    MS-Off Ver
    O365 32bit (Windows)
    Posts
    2,035

    Re: Update the code so the ''Completed'' events seem at the top of the bottom list

    You're welcome. Many thanks for the feedback

  8. #8
    Valued Forum Contributor
    Join Date
    08-08-2022
    Location
    Buenos Aires
    MS-Off Ver
    Excel 2019
    Posts
    1,777

    Re: Update the code so the ''Completed'' events seem at the top of the bottom list

    Hi ramilh.
    Did you get to look at the proposal in post #4?...

  9. #9
    Registered User
    Join Date
    11-24-2022
    Location
    Istanbul, Turkey
    MS-Off Ver
    Excel 2019
    Posts
    36

    Re: Update the code so the ''Completed'' events seem at the top of the bottom list

    Actually it didnt quite work for me and I couldn't adapt the other code to my worksheet too.
    If you can add that cutting and adding to the top of the list to the code below, it would be much appreciated.

    Option Explicit

    Private Sub Worksheet_Change(ByVal Target As Range)
    Dim lr&, r&, cell As Range
    lr = Cells(Rows.Count, "B").End(xlUp).Row
    If Intersect(Target, Range("F2:F" & lr - 1)) Is Nothing Then Exit Sub
    For Each cell In Target
    If LCase(cell.Value) <> "completed" Then Exit Sub
    r = cell.Row
    Range(Cells(r, "B"), Cells(r, "E")).Cut Cells(lr + 1, "B")
    Cells(lr + 1, "F").Value = "Completed"
    Application.EnableEvents = False
    Range(Cells(r, "B"), Cells(r, "F")).Delete xlUp
    Application.EnableEvents = True
    Next
    End Sub

  10. #10
    Valued Forum Contributor
    Join Date
    08-08-2022
    Location
    Buenos Aires
    MS-Off Ver
    Excel 2019
    Posts
    1,777

    Re: Update the code so the ''Completed'' events seem at the top of the bottom list

    That is not how things are done, ramilh.

    As far as I'm concerned you hadn't even appreciated the help provided by clicking "+rep".

    On the other hand, what you should do is publish a new post in which you will attach the workbook in which you implemented the suggestion to see what is the reason why the suggestion has not worked for 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. Count a number of completed events happened in a day
    By tg0809 in forum Excel General
    Replies: 5
    Last Post: 05-17-2017, 12:14 PM
  2. Replies: 13
    Last Post: 01-26-2016, 08:45 PM
  3. Replies: 1
    Last Post: 01-21-2016, 03:34 PM
  4. [SOLVED] Userform multipage control exit events code execution not completed before next user entry
    By jane serky in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-10-2013, 04:39 AM
  5. disabling Update Values until completed with vba code
    By meghanalissa in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-23-2013, 06:51 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. Code to ensure Data Validation list completed
    By baggy098 in forum Excel General
    Replies: 1
    Last Post: 12-23-2006, 08:29 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