# Countif Macro

Oct 27, 2006In col A (from A2 and down), I want to run a Countif on a Range of concatenated values in Col B (B2 and down)

I'm having trouble with the Countif part of my code

Sub countifDataRange()

Range("A2").Value = Range("B2")

Dim LastRow As Long

LastRow = Range("B" & Rows.Count).End(xlUp).Row

With Range("A2:A" & LastRow)

.Formula = "=COUNTIF(Range("B2:B" & LastRow), "B" & Rows.Count)"

.Value = .Value

End With

End Sub