title: Selecting Dropdown list in IE with VBA
body: <p>I have been trying to select a drop down list in a web page using VBA, which I'm new to. In HTML the drop down menu is stated as <strong>Button</strong> and not <strong>Select</strong>. Here is the HTML code:</p>
  
  <pre><code>&lt;span class='btn-group'&gt;
    &lt;button id='str_listing-btn' name='str_listing-btn' type='button' class='btn btn-default dropdown-toggle' data-toggle='dropdown' data-value='For Sale'&gt;
      For Sale
      &lt;span class='caret' style='margin-left:5px;'&gt;
      &lt;/span&gt;
    &lt;/button&gt;
    &lt;ul class='dropdown-menu wptk_crud_dropdown' id='str_listing' data-value='str_listing' role='menu'&gt;
      &lt;li&gt;
        &lt;a href='#' data-value='For Sale'&gt;For Sale&lt;/a&gt;
      &lt;/li&gt;
      &lt;li&gt;
        &lt;a href='#' data-value='For Rent'&gt;For Rent&lt;/a&gt;
      &lt;/li&gt;
      &lt;li&gt;
        &lt;a href='#' data-value='Wanted To Buy'&gt;Wanted To Buy&lt;/a&gt;
      &lt;/li&gt;
      &lt;li&gt;
        &lt;a href='#' data-value='Wanted To Rent'&gt;Wanted To Rent&lt;/a&gt;
      &lt;/li&gt;
    &lt;/ul&gt;
  &lt;/span&gt;
  </code></pre>
  
  <p>I have tried a few VBA codes to select one of the options. Below is the latest code that I have used but after running it nothing seems to happen to the drop down menu:</p>
  
  <pre><code>Private Sub InsertPropwall_Click()
  
  Dim objIE1 As Object
  objIE1.navigate ("http://www.propwall.my/classifieds/post_ad?action=add")
  
  Do
  DoEvents
  Loop Until objIE1.ReadyState = 4
  
  objIE1.Document.getElementById("str_listing-btn").Value = "For Rent"
  
  Do
  DoEvents
  Loop Until objIE1.ReadyState = 4
  
  End Sub
  </code></pre>