Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
How can I delete duplicated data
I have a workbook and I need to delete certain data. What it is if the time difference in columns C and D is less than 2 mins I need that row deleted and cells shifted up. It will always be in columns C and D and will be numerous rows. Has anyone any idea as to how I can do this. Dosent matter if it works up or down the workbook. I.E if C and D 14 time diff is less than 2 mins I need that row deleted and cells shifted up. Can anyone help. Thanks -- tweacle |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
How can I delete duplicated data
You can use this code in VBA:
'--------------------------------------------------- Sub DeleteRows() Dim ws As Worksheet Set ws = Worksheets("sheet2") For i = ws.Cells(65536, 1).End(xlUp).Row To 2 Step -1 If IsDate(ws.Cells(i, 4)) And IsDate(ws.Cells(i, 3)) Then If ws.Cells(i, 4) - ws.Cells(i, 3) < 1.38888888614019E-03 Then Debug.Print i & ":"; ws.Cells(i, 4) - ws.Cells(i, 3) Rows(i).Interior.ColorIndex = 3 End If End If Next i End Sub '--------------------------------------------------- hth Carlo On Dec 20, 5:29 am, tweacle wrote: I have a workbook and I need to delete certain data. What it is if the time difference in columns C and D is less than 2 mins I need that row deleted and cells shifted up. It will always be in columns C and D and will be numerous rows. Has anyone any idea as to how I can do this. Dosent matter if it works up or down the workbook. I.E if C and D 14 time diff is less than 2 mins I need that row deleted and cells shifted up. Can anyone help. Thanks -- tweacle |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to delete duplicated values in each row ??? | Excel Discussion (Misc queries) | |||
how to delete duplicated content from 2 cells | Excel Worksheet Functions | |||
How to delete duplicated records. Each record has four lines | Excel Discussion (Misc queries) | |||
Delete non duplicated rows | Excel Discussion (Misc queries) | |||
Find & delete duplicated entries. | Excel Discussion (Misc queries) |