View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
mudraker[_268_] mudraker[_268_] is offline
external usenet poster
 
Posts: 1
Default Compare two col to same two on next row

Morry

Hopefully I understand your problem correctly

This version puts the text of column G into column H

If I have done it correctly it would then only require counting eac
time each item is listed.

I did not want to add any more code in case I still have not this firs
part right


Sub CountDup2()
Dim lRow As Long

For lRow = 1 To Cells.Find(what:="*", _
SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious).Row Step 1

If Cells(lRow, "b").Value = _
Cells(lRow + 1, "b").Value Then
If Cells(lRow, "g").Value = _
Cells(lRow + 1, "g").Value Then
Range("h" & lRow + 1).Value = Cells(lRow, "g").Value
End If
End If
Next
End Su

--
Message posted from http://www.ExcelForum.com