Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default deleting duplicates

I have rows a, b, and c that need to be analyzed for duplicate data. Also
there are blanks in row B. I've tried extending the range but then when I
test it, it still shows zero. Can someone please help me. thank you
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 791
Default deleting duplicates

Try this:
Sub DeleteRows()
Set r = ActiveSheet.UsedRange
nLastRow = r.Rows.Count + r.Row - 1
For i = nLastRow To 1 Step -1
For j = 1 To Columns.Count
v = Cells(i, j).Value
If InStr(1, v, "delete") 0 Then
Cells(i, j).EntireRow.Delete
Exit For
End If
Next
Next
End Sub
--
If this posting was helpful, please click on the Yes button.
Regards,

Michael Arch.




"Nolaughmtr" wrote:

I have rows a, b, and c that need to be analyzed for duplicate data. Also
there are blanks in row B. I've tried extending the range but then when I
test it, it still shows zero. Can someone please help me. thank you

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 13
Default deleting duplicates

no that didnt work. i dont htink it did anything.

"Michael" wrote:

Try this:
Sub DeleteRows()
Set r = ActiveSheet.UsedRange
nLastRow = r.Rows.Count + r.Row - 1
For i = nLastRow To 1 Step -1
For j = 1 To Columns.Count
v = Cells(i, j).Value
If InStr(1, v, "delete") 0 Then
Cells(i, j).EntireRow.Delete
Exit For
End If
Next
Next
End Sub
--
If this posting was helpful, please click on the Yes button.
Regards,

Michael Arch.




"Nolaughmtr" wrote:

I have rows a, b, and c that need to be analyzed for duplicate data. Also
there are blanks in row B. I've tried extending the range but then when I
test it, it still shows zero. Can someone please help me. thank you

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
Deleting Duplicates Angie M. Excel Worksheet Functions 2 February 4th 10 03:55 PM
Deleting Duplicates Jane Excel Discussion (Misc queries) 3 August 17th 07 02:58 AM
Deleting duplicates katana Excel Discussion (Misc queries) 4 February 7th 06 06:33 PM
Deleting Duplicates halem2[_45_] Excel Programming 1 October 19th 04 09:11 PM
Deleting Duplicates Charles Deng Excel Programming 3 May 12th 04 05:40 PM


All times are GMT +1. The time now is 06:11 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"