Compare Version Number Strings

  • I have two numbers, they are version numbers, I am having problems with my If then else and elseif statements.

    59821 for version
    is more than
    5983 for version

    even though is a greater version number. Do you see where my problem is. How do I compare # by # reading it, checking to see what one is bigger and going from there.

    so when it gets to the 3 of the 5983 its bigger than 2 of 5982 of the

    Am I making any since?

  • Re: If Then Else Elseif Comparing Text Numbers

    Thanks that worked when I put it on the sheet. I couldn't figure out how to make that into VBA to do the same. Thanks again!

  • Re: Compare Version Number Strings

    I have the same problem, so I wrote a quick function to solve the problem. It works quite well and even if you use letters in your version it still works. Obly if you compare capital with small letters weird things are happening (but for my purpose there are just small letters in use).

    I am happy if you have some feedback or if you find a better solution/improvement. Thanks.

  • Re: Compare Version Number Strings

    blablubbb Thank You. Just found a spelling error in Version1Array and changed the Application.Min function to standard vba:

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!