View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default Finding the last one

This is very easy. Too easy

RowCount = 1
do while cells(RowCount,"A").value < ""
if cells(RowCount,"A").value = _
cells(RowCount + 1,"A").value then

Rows(RowCount).delete
else
RowCount = RowCount + 1
end if
loop


" wrote:

I have colums and rows of data. The data is grouped in four rows down
two columns across. I sometime have repeating data. I am trying ot
figure out a way so that it looks through the colum find the first and
the last then deletes all but the last.

Ex.

Layer1
Layer2
Layer3
Layer4
Layer5 <----delete this one
Layer5 <----delete this one
Layer5 <----delete this one
Layer5 <--- keep this one

It's always the last part of the data. Layer five is the highest it
will go if that help. Thanks.