Hi guys,
i have in column A a registration number, and i want to insert a column to add a countif formula to calculate how many times a number appears in my sheet. I had no problems in doing so but i want to know how to write the code so that the countif formula to stop at the last number in column a instead of going all the way down.
my code so far
Regards,
Ossian
i have in column A a registration number, and i want to insert a column to add a countif formula to calculate how many times a number appears in my sheet. I had no problems in doing so but i want to know how to write the code so that the countif formula to stop at the last number in column a instead of going all the way down.
my code so far
Code:
Columns("B:B").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Range("B2").Select
ActiveCell.FormulaR1C1 = "=COUNTIFS(A:A,A2)"
Range("B2").Select
Selection.AutoFill Destination:=Range("B2:B2" & xLastrow)
Regards,
Ossian