title: Excel VBA Select Option from Website Dropdown List while filling webform
body: <p>I am trying to automate this website using VBA excel. I am struck at a point where I have to select value from the dropdown box. I am very much new to VBA and tis is my 1st such project. this is what I have coded to select the value.</p>
  
  <pre><code>Sub automaticformfilling_ASDA()
  
      Dim ie As Object
  
      Set ie = CreateObject("internetexplorer.application")
  
      'to make sure that the website is properly loaded
  
      With ie
          .Visible = True
          .navigate "https://www.argos-pet-insurance.com/quoteAndBuy.do?e=e1s1&amp;curPage=captureDetails&amp;rakT=1510852044896.1391473424.994101.1731.881880349.846|tsid:9904"
  
          Do While .Busy
              DoEvents
          Loop
  
          Do While .readyState &lt;&gt; 4
              DoEvents
          Loop  
      End With
  
      Set Title = i.e.document.getElementById("yourDetailsPolicyHolderTitle")
  
      For i = 1 To Title.Options.Length
         If Title.Options(i).Text = "Mrs" Then
           Exit For
         End If
      Next i
  
  End Sub
  </code></pre>
  
  <p>Here is the HTML of that section:</p>
  
  <pre><code>&lt;select name="policyHolder.title" class="select-large" id="yourDetailsPolicyHolderTitle" data-di-field-id="policyHolderTitle"&gt;
     &lt;option selected="selected" value=""&gt;Please select&lt;/option&gt;
     &lt;option value="NWA_PET_T5"&gt;Dr&lt;/option&gt;
     &lt;option value="NWA_PET_T3"&gt;Miss&lt;/option&gt;
     &lt;option value="NWA_PET_T1"&gt;Mr&lt;/option&gt;
     &lt;option value="NWA_PET_T2"&gt;Mrs&lt;/option&gt;
     &lt;option value="NWA_PET_T4"&gt;Ms&lt;/option&gt;
  &lt;/select&gt;
  </code></pre>