Limit occurrences using VBA
On Monday, April 14, 2014 3:01:03 PM UTC-5, wrote:
Hi,
I have a list of numbers in column A that are grouped together. What I need to do is count the number of each numeric occurrence and alert the user if the number is greater than 2. So if I have the number 5 show up 3 times. The user will be notified that there is a problem. I believe the code would be similar to:
If Application.Countif(ColumnA:A, rowname) 2 then
MsgBox "Problem on line" & rowname & "."
End if
Thanks,
James
Thank you, Isabelle. I really appreciate your help. I'm not sure that will make everyone happy, but it really close. I may have to use a loop and counter, and run it from a button.
James
|