title: VBA to click on a button in IE with no ID, Name, ClassName
body: <p>I need to click on a button in IE. I tried few options with no success. Everything i tried are using TagName/ ClassName/ Name/ ID. But I don't find any of these in the below.</p>
  
  <pre><code>&lt;FORM method=post name=frmSearch action=searchResultsSummary&gt;
  &lt;INPUT type=hidden value=GMT+01:00 name=clitz&gt; 
  &lt;DIV style="MARGIN-LEFT: 30px"&gt;
  &lt;DIV style="MARGIN-BOTTOM: 10px; FONT-WEIGHT: bold"&gt;Common Criteria&lt;/DIV&gt;
  &lt;TABLE style="MARGIN-LEFT: 20px" cellSpacing=5 cellPadding=0 border=0&gt;
  &lt;TBODY&gt;
  &lt;TR&gt;
  &lt;TD id=oDocumentCategoryCell style="HEIGHT: 22px" colSpan=3 noWrap&gt;Document category:&lt;/TD&gt;
  &lt;TD colSpan=3 align=left&gt;
  &lt;SELECT style="DISPLAY: block" name=docCategory old_value="2"&gt;
  &lt;OPTION value=%&gt;Any Category&lt;/OPTION&gt;
  &lt;OPTION value=FINANCE&gt;Finance Document&lt;/OPTION&gt;
  &lt;OPTION selected value=INBOUND&gt;Inbound Document&lt;/OPTION&gt;
  &lt;OPTION value=PROCESS&gt;Internal Process&lt;/OPTION&gt;
  &lt;OPTION value=OUTBOUND&gt;Outbound Document&lt;/OPTION&gt;
  &lt;/SELECT&gt;
  &lt;/TD&gt;
  &lt;TD style="WIDTH: 15px"&gt;&lt;/TD&gt;
  &lt;TD&gt;
  &lt;INPUT onclick="javascript:if (!validateSearchForm()) return;if (!checkCountOfDays()) return; addRefKeysToForm(frmSearch); frmSearch.submit();" style="WIDTH: 100px" type=button value=Search&gt;
  &lt;/TD&gt;&lt;/TR&gt;
  &lt;TR&gt;
  &lt;TD style="HEIGHT: 22px" colSpan=3 noWrap&gt;Document type:&lt;/TD&gt;
  &lt;TD colSpan=3 align=left&gt;
  &lt;SELECT style="DISPLAY: block" name=docType old_value="0"&gt;
  &lt;OPTION selected value=%&gt;Any Type&lt;/OPTION&gt;
  &lt;OPTION value=CSN_ORD_VALID&gt;CSN Order Validation&lt;/OPTION&gt;
  &lt;OPTION value=CREDIT_ORD&gt;Credit Order&lt;/OPTION&gt;
  &lt;OPTION value=EOI_ORDCPY&gt;EOI Order Copy&lt;/OPTION&gt;
  &lt;OPTION value=LEASE_ORD&gt;Lease Order&lt;/OPTION&gt;
  &lt;OPTION value=ORDER_REPORT&gt;Order Load Report&lt;/OPTION&gt;
  &lt;OPTION value=TRADE_ORD&gt;Trade Order&lt;/OPTION&gt;
  &lt;OPTION value=WATSON&gt;WATSON Quote&lt;/OPTION&gt;
  &lt;OPTION value=WATSON_UPDATE&gt;WATSON Update Quote&lt;/OPTION&gt;
  &lt;OPTION value=WNGQ&gt;WNGQ Request&lt;/OPTION&gt;&lt;/SELECT&gt; &lt;/TD&gt;&lt;/TR&gt;
  &lt;TR&gt;
  </code></pre>
  
  <p>I tried going by input tags and it is not working.</p>
  
  <p>I used the below code. It clicks on the button i want but it is not considering the values i gave before clicking on submit button.</p>
  
  <pre><code>Dim btnInput As MSHTML.HTMLInputElement
  Dim frm As MSHTML.IHTMLElementCollection
  Application.ScreenUpdating = True
  
  Set frm = ie.Document.getElementsByName("frmSearch")
  For Each btnInput In frm
  
  If btnInput.Value = "frmSearch.submit()" Then
      btnInput.submit
      Exit For
  End If
  Next btnInput
  </code></pre>
  
  <p>Can some one help me on how to click on the button.</p>