joycesolomon
New Member
- Joined
- Aug 2, 2011
- Messages
- 48
Hi
I am trying to put the below macro recorded code into a loop since i have about 200 rows that needs this
ActiveCell.FormulaR1C1 = "=COUNTIF(RC[-2]:R[65534]C[-2],RC[-1])"
Range("E3").Select
ActiveCell.FormulaR1C1 = "=COUNTIF(R[-1]C[-2]:R[65533]C[-2],RC[-1])"
Range("E4").Select
ActiveCell.FormulaR1C1 = "=COUNTIF(R[-2]C[-2]:R[65532]C[-2],RC[-1])"
Range("E5").Select
ActiveCell.FormulaR1C1 = "=COUNTIF(R[-3]C[-2]:R[65531]C[-2],RC[-1])"
Range("E6").Select
ActiveCell.FormulaR1C1 = "=COUNTIF(R[-4]C[-2]:R[65530]C[-2],RC[-1])"
Range("E7").Select
Can someone please help. What i am trying to achieve is I have column C that has dates that has duplicates, i have sorted it without duplicate in column D. I want to know how many time(count) each date in column D has duplicate, which is the loop i want for column E. Can someone please help...i am so not good in loops and VBA
I am trying to put the below macro recorded code into a loop since i have about 200 rows that needs this
ActiveCell.FormulaR1C1 = "=COUNTIF(RC[-2]:R[65534]C[-2],RC[-1])"
Range("E3").Select
ActiveCell.FormulaR1C1 = "=COUNTIF(R[-1]C[-2]:R[65533]C[-2],RC[-1])"
Range("E4").Select
ActiveCell.FormulaR1C1 = "=COUNTIF(R[-2]C[-2]:R[65532]C[-2],RC[-1])"
Range("E5").Select
ActiveCell.FormulaR1C1 = "=COUNTIF(R[-3]C[-2]:R[65531]C[-2],RC[-1])"
Range("E6").Select
ActiveCell.FormulaR1C1 = "=COUNTIF(R[-4]C[-2]:R[65530]C[-2],RC[-1])"
Range("E7").Select
Can someone please help. What i am trying to achieve is I have column C that has dates that has duplicates, i have sorted it without duplicate in column D. I want to know how many time(count) each date in column D has duplicate, which is the loop i want for column E. Can someone please help...i am so not good in loops and VBA