title: excel vba macro - extract value from where clause
body: <p>In columnA of excel sheet 'Input' I have the following (with each line being on a new row in the sheet):</p>
  
  <pre><code>    update my_table
      set time = sysdate,
      randfield1 = 'FAKE',
      randfield5 = 'ME',
      the_field8 = 'test'
      where my_key = '84'
      ;
      update my_table
      set time4 = sysdate,
      randfield7 = 'FAeKE',
      randfield3 = 'MyE',
      the_field9 = 'test'
      where my_key = '37';
  </code></pre>
  
  <p>I'm trying to create a new sheet 'output' that only contains the following values in columnA but I don't know how to extract the bit in between the quotes after --> where my_key:</p>
  
  <pre><code>84
  37
  </code></pre>
  
  <p>Some notes: it would be great to be able to specify the fieldname in cell B1 of sheet 'input', in this example it would be my_key.</p>
  
  <p>Previously, I've been doing this manually using filter column where text contains 'where' then stripping out everything after the equals then doing a find/replace on single quotes and ;s. Has anyone been able to achieve this with a single button click macro?</p>