title: Calculate percentage and populate result in another Excel worksheet
body: <p>I need help creating a macro/vba to query from an excel database called "database" to match multiple criteria in "Results" and calculate a percentage and populate in a column.  </p>
  
  <p><a href="https://docs.google.com/file/d/0ByCB_rXHlkEba05RU3p5RGlnM1U/edit?pli=1" rel="nofollow">https://docs.google.com/file/d/0ByCB_rXHlkEba05RU3p5RGlnM1U/edit?pli=1</a></p>
  
  <p><strong>Worksheet - "Database"</strong></p>
  
  <pre><code>Fields:
  YEAR 
  Region# 
  Region_Name 
  Store#  
  Store_NAME  
  ITM-GRADE   
  Whse    
  Item#   
  Item_Desc   
  Type    
  Group   
  Qty
  </code></pre>
  
  <p><strong>Worksheeet = "Results"</strong> </p>
  
  <pre><code>Criteria        Year      2005      2005      2005   2005
  Criteria        ITM-GRADE GradeA1   GradeA1   GradeA1    GradeA1
  Criteria        Whse      Whse2     Whse2     Whse2  Whse2
  Criteria        Group     11 to 44  11        55 to 66   55 to 66
  Criteria        Type      Q1        Q2        Q1     Q2
  
  Region# Store#  percentage          
  1001    1001-002    Group 11-44 divided by Group 11-66          
  1001    1001-003    %   %   %   %
  1001    1001-004    %   %   %   %
  1003    1003-001    %   %   %   %
  1003    1003-002    %   %   %   %
  1003    1003-003    %   %   %   %
  1005    1005-001    %   %   %   %
  </code></pre>
  
  <p>vba to match Region#, Store#, Year, ITM-Grade, Whse, Group, Type with "Database" take Group 11-44 divided by Group 11-66 and populate the percentage in each column.  Thanks for your help.</p>