ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   counting entities with the same values (https://www.excelbanter.com/excel-programming/277695-re-counting-entities-same-values.html)

Alan Beban[_3_]

counting entities with the same values
 
If the functions in the freely downloadable file at
http:??home.pacbell.net/beban are available to your workbook, the
following will enter in Cell E1 the number of rows (including the first)
equal to the first row:

Sub test2()
Dim rng As Range, k As Long
Set rng = Range("a1:d7").Rows
For i = 1 To rng.Count
If RowsEqual(rng(1), rng(i + 1)) Then k = k + 1
Next
rng(1).Cells(1, 5).Value = k + 1
End Sub

Alan Beban

solo_razor wrote:
hello,

I want to count rows that contain the same data that is not specified
in any way.

e.g.

a b c d

1 2 3 4
1 2 3 4
2 1 3 4

now i need a formula or code to compare rows and if they match count
the rows and give an output to a specified cell

Thanks



------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~ View and post usenet messages directly from http://www.ExcelForum.com/




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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com