title: Best way to compare strings in VBA?
body: <p>I've been using VBA for the past month now (for my job) and since I've begun using this language/script, <strong>there have been several occurances where I have issues comparing strings</strong>.. the ways that I've compared strings so far are:</p>
  
  <ul>
  <li><strong>str1 = str2</strong> and <strong>str1 &lt;> str2</strong></li>
  <li><strong>StrComp(str1, str2, comparisonMethod)</strong></li>
  <li><strong>InStr(str1, str2)</strong></li>
  </ul>
  
  <p>Sometimes, before using one of these comparison methods, <strong>I'll first apply UCase(str1), or even UCase(Trim(str1))</strong>. From my experience so far though, <strong>comparing strings in VBA seems to be a rather fickle thing</strong>, because I feel like I get inconsistent results. </p>
  
  <p><strong>QUESTION:</strong> What is the <strong><em>best procedure</em> for comparing two strings in VBA</strong>?</p>
  
  <p>For example: Imagine there are two lists.. one list contains laptop models, the other contains parts numbers. The goal is to associate all part numbers with a model. My results produce only partial associations, meaning that if I have 10 part numbers that should associate with a model, only 5 or 6 actually are. I then take the strings that don't properly compare and compare again in seperate code, and will then get the correct result. This kind of behavior has been somewhat consistent throughout my use of VBA, and is where the "feeling" comes from. </p>