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
I've been told that using a change event is not the preferred method of doing this. Is there a way to run it another way, such as by a command button?
Thanks,
James
|