CompareValue – Check whether a value is in a list of values

' Compares a numeric or string value with a list of other values.' Returns the 1-based index of the matching value, or zero if the' value doesn't appear in the list.' String comparisons are case-sensitive.'' This function can conveniently replace a Select Case or a list' of ORed comparison, e.g. you can replace the following line'        If s = "one" Or s = "Two" Or s = "Three" Then' with the more concise'        If CompareValue(s, "One", "Two", "Three") ThenFunction CompareValue(ByVal value As Object, ByVal ParamArray valueList() As _    Object) As Integer    Return Array.IndexOf(valueList, value) + 1End Function

Share the Post:
Share on facebook
Share on twitter
Share on linkedin


The Latest

microsoft careers

Top Careers at Microsoft

Microsoft has gained its position as one of the top companies in the world, and Microsoft careers are flourishing. This multinational company is efficiently developing popular software and computers with other consumer electronics. It is a dream come true for so many people to acquire a high paid, high-prestige job

your company's audio

4 Areas of Your Company Where Your Audio Really Matters

Your company probably relies on audio more than you realize. Whether you’re creating a spoken text message to a colleague or giving a speech, you want your audio to shine. Otherwise, you could cause avoidable friction points and potentially hurt your brand reputation. For example, let’s say you create a

chrome os developer mode

How to Turn on Chrome OS Developer Mode

Google’s Chrome OS is a popular operating system that is widely used on Chromebooks and other devices. While it is designed to be simple and user-friendly, there are times when users may want to access additional features and functionality. One way to do this is by turning on Chrome OS