willow1985
Well-known Member
- Joined
- Jul 24, 2019
- Messages
- 929
- Office Version
- 365
- Platform
- Windows
Hello,
I am looking to speed up a macro of mine, specifically a COUNTIF formula and I was wondering if the following is possible:
My COUNTIF formula is basic: =COUNTIF(A:A,A2)
When I utilize it I am doing so by entering the VBA code:
to determine what the last cell is in which to copy down the formula, however the count if formula is still referencing all of column A.
Is there a way to modify this formula in VBA to determine where the data in A ends so I do not have to reference it all? Would this speed up the calculation?
Any ideas would be greatly appreciated, thank you
Carla
I am looking to speed up a macro of mine, specifically a COUNTIF formula and I was wondering if the following is possible:
My COUNTIF formula is basic: =COUNTIF(A:A,A2)
When I utilize it I am doing so by entering the VBA code:
Code:
LastRowColumnA = Cells(Rows.Count, 1).End(xlUp).Row
Range("T2:T" & LastRowColumnA).Formula = "=COUNTIF(C[-19],RC[-19])"
to determine what the last cell is in which to copy down the formula, however the count if formula is still referencing all of column A.
Is there a way to modify this formula in VBA to determine where the data in A ends so I do not have to reference it all? Would this speed up the calculation?
Any ideas would be greatly appreciated, thank you
Carla