Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>If all you want to do is count the number of ocurrences of a certain numer in a certain range all you have to do is use COUNTIF(range,criteria)</p> <p>where range is the cells where you want to check ( according to you it would be "A1:A4000") and criteria is the number you are loonking for, it can also be an ocrrence like ">55" where it counts how many cells the value is bigger than 55.</p> <p>Hope it helps, Bruno</p> <p>The code i mentioned in the comment:</p> <pre><code>CurrentRowA = 1 LastRowA = Range("A50000").End(xlUp).Row Dim r As Range While CurrentRowA &lt;= LastRowA CurrentRowB = 1 LastRowB = Range("B50000").End(xlUp).Row Do While CurrentRowB &lt;= LastRowB If Cells(CurrentRowA, "A").Value = Cells(CurrentRowB, "B").Value Then Exit Do Else CurrentRowB = CurrentRowB + 1 End If Loop If CurrentRowB &gt; LastRowB Then Cells(CurrentRowB, "B").Value = Cells(CurrentRowA, "A").Value Set r = Range("A1", "A" &amp; LastRowA) Cells(CurrentRowB, "C").Value = Application.CountIf(r, Cells(CurrentRowA, "A").Value) End If CurrentRowA = CurrentRowA + 1 Wend LastRowB = Range("B50000").End(xlUp).Row Range("B2", "C" &amp; LastRowB).Cut Range("B1").Select ActiveSheet.Paste </code></pre> <p>If what i described in my latest comment is what you really want all you have to do is paste this formulas in B1 =COUNTIF($A$1:A1;A1) and drag it to the last cell or double click in that blac square on B1 bottomtight corner, then if the calcution is automatic it's done, if it's manual you have to click calculate now and it's done</p> <p>Hope it helps, Bruno</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload