One of the aims of VB is to read like an English sentence. If you clearly say or, better still, write down what it is that you want to do then you are often halfway, or event further, to writing the code. So, what is it that you want to do? If the name starts with M and is alphabetically less than MJ then set some value to M1, otherwise set the value to M2. That should give you most of what you need to write the code.