• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Compare time in cells

Chris L

New Member
I have a batch process that records and saves data every 30 seconds into an excel file. The file might be 18 hours worth of data but I only need to report to our customer a specific time range based on specific conditions. The interval we report is every 15 minutes in a h:mm:ss format. I some times end up with the last two rows being the same hour & minute just 30 seconds apart.
I need a way to look at two specific cells, compare the minutes and if they are the same delete the first row.

In the attached file I would like to delete row 18.
 

Attachments

  • Time.xlsx
    12.4 KB · Views: 7
According to your attachment a VBA demonstration as a beginner starter :​
Code:
Sub Demo1()
    With [A1].CurrentRegion.Rows
        If Left(.Cells(.Count - 1, 1).Text, 5) = Left(.Cells(.Count, 1).Text, 5) Then .Item(.Count - 1).Delete
    End With
End Sub
Do you like it ? So thanks to click on bottom right Like !
 
Back
Top