View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
jscorsone jscorsone is offline
external usenet poster
 
Posts: 5
Default Delete rows if data changes in particular column

That's exactly what I needed. Thanks so much for your assistance!

"Don Guillett" wrote:

for
1
1
1
2
2
3
this will leave
1
2
3
Sub deletedups()
mc = "b"
For i = Cells(Rows.Count, mc).End(xlUp).Row To 2 Step -1
If Cells(i - 1, mc) = Cells(i, mc) Then Rows(i).Delete
Next
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"jscorsone" wrote in message
...
Sure, I didn't explain that very well.

I have 6 columns of data, thousands of rows of data.

Columns B, C, D, E, F will change. The column I'm concerned with is
Column
B, Item Number. There are multiple rows of data with the same Item Number
(Column B.)

I'd like to delete all rows after the first row for a particular item
name,
until Column B changes to a new number.


"Don Guillett" wrote:

More info

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"jscorsone" wrote in message
...
Hi, I'm seeking assistance with a macro. I'm trying to delete
subsequent
rows if data in a particular cell in Column B changes.

I need to create a macro because there are thousands of products and
using
autofilter to sort and delete would take a while.

Any assistance would be greatly appreciate, thanks!