title: How to extract a generic string (pattern) of character & digits in VBA?
body: <p>I'm trying to build a function on which I'm blocked since a long time now.</p>
  
  <p>I would like, from a string in a cell, extract a sub-string like "ABC123" or "AB1234". There are some conditions :</p>
  
  <ul>
  <li>It must be like "ABC123" or "AB1234" so <strong>3 char and 3 Numeric</strong> or <strong>2 char and 4 Numeric</strong>. I.e. "CDE789" is therefore also one of the pattern. </li>
  <li>The String in which we are looking has no particular size. It may contain, or not, the pattern.</li>
  <li>If the search term should have a space after or before (then only that pattern). Not that it doesn't apply if we are at the beginning of the string or at the end.</li>
  <li>The function should return that particular set of string (i.e. in a column besides that already exist).</li>
  </ul>
  
  <p>I tried the like function, arrays or even dictionary but I can't find a solution. For instance I tried to loop trough the LEN of the string, subdivide in 6 variables and check with an IF if the first 2 where char and the last 4 where digits. It's quite heavy and not applicable for a large set of data.</p>
  
  <p>Also please apologies for my broken English, do not hesitate to correct me, I'm also her to learn this :)</p>
  
  <p>Thank you !</p>