title: how to read data from an excel worksheet dynamically using VBA 2003
body: <p>I am new to vba programming hence I need your expert help in trying to be able to able to read all values from the following excel sheet into a ADODB recordset object using VBA 2003 </p>
  
  <p><img src="https://i.stack.imgur.com/Itu8W.png" alt="enter image description here">
  The recordset will be populated as follows</p>
  
  <pre><code>   'Create new recordset with the following fields
          Dim rsData as new ADODB.Recordset
          rsData.Fields.Append "Month", adVarChar, 20
          rsData.Fields.Append "Product", adVarChar, 20
          rsData.Fields.Append "Type", adVarChar, 50
          rsData.Fields.Append "Value", adVarChar, 50
          rsData.Open
  
  
      'for each row in spreadsheet read the following info
         rsData.Addnew
              rsData.Fields("Month") = 'value from row 2 Jan followed by data below
              rsData.Fields("Product") = "Color" ' Value from B5
              rsData.Fields("Type") = "MK1" ' value from C5
              rsData.Fields("Value") = "111=" ' value from D6
  
  'Now move to next set of values for Feb
  
      rsData.Addnew
              rsData.Fields("Month") = 'value from row 2 FEB
              rsData.Fields("Product") = "Shade" ' Value from F5
              rsData.Fields("Type") = "AB2" ' value from G5
              rsData.Fields("Value") = "345=ABX" ' value from H5
  
      'Now move to next set of values for Mar
      rsData.Addnew
              rsData.Fields("Month") = 'value from row 2 MAR
              rsData.Fields("Product") = "Color" ' Value from F5
              rsData.Fields("Type") = "3FG" ' value from G5
              rsData.Fields("Value") = "PLZ" ' value from H5
  
      'Now move to next row
   rsData.Addnew
              rsData.Fields("Month") = 'value from row 2 Jan
              rsData.Fields("Product") = "Color" ' Value from F5
              rsData.Fields("Type") = "MK2" ' value from C6
              rsData.Fields("Value") = "234=BZX" ' value from D6
  
  ...and so on
  </code></pre>
  
  <p>Please note, **the data may move around but the overall layout will remain unchanged.</p>
  
  <p>As you can see from the following diagram. the order has changed: Jan , march, Feb**</p>
  
  <p><img src="https://i.stack.imgur.com/uKxet.png" alt="enter image description here"></p>