PC Review


Reply
Thread Tools Rate Thread

How to delete that row if same cell in preceding row is identical

 
 
Ronmarco
Guest
Posts: n/a
 
      24th Apr 2008
I have data that duplicates a cell in the previous row and I want to delete
the second row each time that happens.
 
Reply With Quote
 
 
 
 
Office_Novice
Guest
Posts: n/a
 
      24th Apr 2008

Sub NewOne()
Do Until ActiveCell.Value = ""
If ActiveCell.Value = ActiveCell.Offset(-1, 0).Value Then
ActiveCell.EntireRow.Delete Shift:=xlUp
ElseIf ActiveCell.Value <> ActiveCell.Offset(-1, 0).Value Then
ActiveCell.Offset(1, 0).Select
End If
Loop
End Sub

"Ronmarco" wrote:

> I have data that duplicates a cell in the previous row and I want to delete
> the second row each time that happens.

 
Reply With Quote
 
Jeff Johnson
Guest
Posts: n/a
 
      24th Apr 2008
"Office_Novice" <(E-Mail Removed)> wrote in message
news:173A49BC-C5E9-4CD9-A6F8-(E-Mail Removed)...

> ActiveCell.EntireRow.Delete Shift:=xlUp


For reference, when you delete an entire row, there's only one way to
shift....


 
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
How to paste a value for a preceding row if a cell is empty kipperkidd Microsoft Excel Programming 1 7th Nov 2009 10:09 AM
fill cell with colour if preceding cell is a negative value POP Microsoft Excel Misc 4 27th Apr 2009 05:35 PM
when correcting why does the cursor delete the preceding words Hoppy Microsoft Outlook Discussion 1 23rd Nov 2008 03:22 AM
How do I reference a cell to another in the preceding worksheet karl.sonja Microsoft Excel Worksheet Functions 8 6th Aug 2008 10:31 PM
Add a zero preceding a value in a cell... Andre vWG Microsoft Excel Discussion 1 5th Sep 2003 12:56 PM


Features
 

Advertising
 

Newsgroups
 


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