View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Claus Busch Claus Busch is offline
external usenet poster
 
Posts: 3,872
Default Delete rows depending on time value

Hi,

Am Tue, 27 Nov 2018 12:17:32 +0000 schrieb F:

I have around 30 spreadsheets with a series of values including those
shown below. I need to remove all rows with the 5 minute entries and
keep those with the 10 minute entries.

From this:
30/09/2018 07:15 23959.093 0
30/09/2018 07:20 23959.093 0
30/09/2018 07:25 23959.093 0


To this:
30/09/2018 07:20 23959.093 0
30/09/2018 07:30 23959.093 0
30/09/2018 07:40 23959.099 0.06


with your time in column A try:

Sub DeleteRows()
Dim LRow As Long, i As Long
Dim wsh As Worksheet

For Each wsh In Worksheets
With wsh
LRow = .Cells(.Rows.Count, "A").End(xlUp).Row
For i = LRow To 1 Step -1
If Minute(.Cells(i, "A")) Mod 10 = 5 Then
.Rows(i).Delete
End If
Next
End With
Next
End Sub


Regards
Claus B.
--
Windows10
Office 2016