Sneaky Pete
New Member
- Joined
- Jun 3, 2016
- Messages
- 23
Hello everyone,
I've got a question about the large function in vba.
I've searched the internet but couldn't find an answer so I hope you can help.
In a sheet there's a range (column c) that contains numbers. The search range is fixed, the Numbers not.
I want to search for the highest and second highest value. No problem with the large function but when there is only 1 value in the range, the second highest gives an error 1004 because there is no second value.
What I want is an if then statement, something like:
If large("c10:c20",2) is nothing (no value/doesn't exists) the secondvalue is 0 esle secondvalue=large("c10:c20,2).
Hope anyone can help me with the code.
thanx
I've got a question about the large function in vba.
I've searched the internet but couldn't find an answer so I hope you can help.
In a sheet there's a range (column c) that contains numbers. The search range is fixed, the Numbers not.
I want to search for the highest and second highest value. No problem with the large function but when there is only 1 value in the range, the second highest gives an error 1004 because there is no second value.
What I want is an if then statement, something like:
If large("c10:c20",2) is nothing (no value/doesn't exists) the secondvalue is 0 esle secondvalue=large("c10:c20,2).
Hope anyone can help me with the code.
thanx