Hi,
i need to use CountIf function inside a for loop, in VBA. I am very new to VBA, so sorry for trivial question.
Column "A" contains cells with text, with several duplicates.
For each cell in "A" column, i want to have in column "B" how many times text is present in the entire column "A"
I use code below, which is always returning "0" ...i think there is an error in how i am indexing cells in the for loop, inside COUNTIF function
For i = 2 To 100
Worksheets("Sheet1").Cells(i, 2).Formula = "=COUNTIF(A:A,cells(i,1).value)"
Next i
any ideas on where is my error?
thanks
i need to use CountIf function inside a for loop, in VBA. I am very new to VBA, so sorry for trivial question.
Column "A" contains cells with text, with several duplicates.
For each cell in "A" column, i want to have in column "B" how many times text is present in the entire column "A"
I use code below, which is always returning "0" ...i think there is an error in how i am indexing cells in the for loop, inside COUNTIF function
For i = 2 To 100
Worksheets("Sheet1").Cells(i, 2).Formula = "=COUNTIF(A:A,cells(i,1).value)"
Next i
any ideas on where is my error?
thanks