PC Review


Reply
Thread Tools Rate Thread

Delete row containing all previous values.

 
 
mohd21uk via OfficeKB.com
Guest
Posts: n/a
 
      10th May 2006
I have a column in a spreadsheet with repeated values for e.g a name which
is repeated 5 times I would like to keep the last row containing this value
but delete all previous rows i.e in this example i would like to keep row
five containing the last occourence of this value and delete all previous
rows.

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...l-new/200605/1
 
Reply With Quote
 
 
 
 
Don Guillett
Guest
Posts: n/a
 
      10th May 2006
try this

Sub deleledupsinpreviousrows()
For i = Cells(Rows.Count, "a").End(xlUp).Row To 2 Step -1
If Cells(i - 1, 1) = Cells(i, 1) Then Rows(i - 1).Delete
Next
End Sub

--
Don Guillett
SalesAid Software
(E-Mail Removed)
"mohd21uk via OfficeKB.com" <u20517@uwe> wrote in message
news:6008940b2b634@uwe...
>I have a column in a spreadsheet with repeated values for e.g a name which
> is repeated 5 times I would like to keep the last row containing this
> value
> but delete all previous rows i.e in this example i would like to keep row
> five containing the last occourence of this value and delete all previous
> rows.
>
> --
> Message posted via OfficeKB.com
> http://www.officekb.com/Uwe/Forums.a...l-new/200605/1



 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to go to last row with values and average previous 30 values soccerdav2003 Microsoft Excel Programming 4 9th Jun 2008 09:45 PM
WORD opens with previous work. Cannot delete previous work =?Utf-8?B?U3RldmU=?= Microsoft Word Document Management 1 11th May 2005 10:09 AM
get previous values owilson Microsoft Access 1 29th Jan 2005 02:05 AM
previous values Jason Microsoft Access Form Coding 3 7th Jan 2005 10:11 PM
Values dependant on previous values =?Utf-8?B?TWF0dHltb28=?= Microsoft Excel New Users 2 1st Oct 2004 01:15 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:06 PM.