Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 367
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to delete duplicated values in each row ??? Oleg Excel Discussion (Misc queries) 2 March 8th 06 12:57 PM
how to delete duplicated content from 2 cells lucent88 Excel Worksheet Functions 2 October 12th 05 10:57 PM
How to delete duplicated records. Each record has four lines Arcesio Hernandez Excel Discussion (Misc queries) 2 July 26th 05 11:44 PM
Delete non duplicated rows cape Excel Discussion (Misc queries) 1 July 8th 05 02:50 AM
Find & delete duplicated entries. Ken G. Excel Discussion (Misc queries) 1 April 21st 05 07:00 AM


All times are GMT +1. The time now is 08:20 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"