Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default How to delete that row if same cell in preceding row is identical

I have data that duplicates a cell in the previous row and I want to delete
the second row each time that happens.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 245
Default How to delete that row if same cell in preceding row is identical


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.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 32
Default How to delete that row if same cell in preceding row is identical

"Office_Novice" wrote in message
...

ActiveCell.EntireRow.Delete Shift:=xlUp


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


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
conditional formatting dependent of preceding cell Beth W Excel Discussion (Misc queries) 1 August 19th 09 05:58 PM
Delete Non-identical but Similar Records Lindy Excel Discussion (Misc queries) 2 August 19th 09 04:11 PM
fill cell with colour if preceding cell is a negative value POP Excel Discussion (Misc queries) 4 April 27th 09 05:35 PM
How do I reference a cell to another in the preceding worksheet karl.sonja Excel Worksheet Functions 8 August 6th 08 10:31 PM
I have 2 identical workbooks within 1 file, how do I delete 1? rexie3 Excel Worksheet Functions 3 March 14th 07 02:53 PM


All times are GMT +1. The time now is 12:53 AM.

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"