The idea hear is that a column contains 80,000 rows filled with values, and I want to create a VBA macro which will read every value and count how many times is present in the column and print it, but the problem is that when the loop reaches the same number again, I do not want to print it again because it's already printed.
This is what I wrote so far but I can not get it to work.
Option Explicit
Sub timesofattack()
Dim count As Long
Dim count2 As Long
Dim d As Long
Dim f As Long
Dim a As Long
Do Until IsEmpty(Cells(d, 2).Value)
f = d
Do Until IsEmpty(Cells(f, 2).Value)
If Cells(d, 2).Value = Cells(f, 2).Value Then
count = count + 1
End If
f = f + 1
Loop
If count = 1 Then
f = 8
Do Until IsEmpty(Cells(f, 2).Value)
If Cells(d, 2).Value = Cells(f, 2).Value Then
count2 = count2 + 1
End If
f = f + 1
Loop
Range("H8").Offset(a, 0).Value = Cells(d, 2).Value
Range("G8").Offset(a, 0).Value = count2
a = a + 1
End If
d = d + 1
Loop
End Sub