anthonyexcel
Active Member
- Joined
- Jun 10, 2011
- Messages
- 258
- Office Version
- 365
- Platform
- Windows
Good morning,
I have 300,000 rows of data in Column A. I am using a Macro that has countif in it and it takes forever to run. I am looking to have a running count greater than 1. Can anyone offer me a different solution? Thanks in advance!
I have 300,000 rows of data in Column A. I am using a Macro that has countif in it and it takes forever to run. I am looking to have a running count greater than 1. Can anyone offer me a different solution? Thanks in advance!
Code:
Sub CountingMoreThanOne()
Dim LR As Integer
LR = Range("A" & Rows.Count).End(xlUp).Row
With Range("B2:B" & LR)
.Formula = "=IF(COUNTIF($A$2:A2,A2)>1,"""",IF(COUNTIF($A$2:$A$26000,A2)>1,COUNTIF($A$2:$A$26000,A2),""""))"
.Value = .Value
End With
End Sub