Hi to all. The following code counts matches (0 or 1) between 2 columns (A & B) and lists them in column D, it works well but I'm like to list them in 4 separate columns instead of one...any ideas?
Public Sub CountA_FillC() Dim RowA As Long, RowB As Long Dim UsedRange As Range: Set UsedRange = ActiveSheet.UsedRange For RowB = 1 To UsedRange.Rows.Count Dim Count As Long: Count = 0 For RowA = 1 To UsedRange.Rows.Count If UsedRange(RowA, "A").Value = UsedRange(RowB, "B").Value Then Count = Count + 1 End If Next RowA UsedRange(RowB, "D").Value = Count Next RowB End Sub