title: Get "href=link" from html page and navigate to that link using vba
body: <p>I am writing a code in Excel VBA to get <code>href</code> value of a class and navigate to that href link 
  (i.e) here is the <code>href</code> value I want to get into my particular Excel sheet and I want to navigate to that link automatically through my VBA code.</p>
  
  <pre><code>&lt;a href="/questions/51509457/how-to-make-the-word-invisible-when-its-checked-without-js" class="question-hyperlink"&gt;How to make the word invisible when it's checked without js&lt;/a&gt;
  </code></pre>
  
  <p>The result I'm getting is that I'm able to get that containing tag's class value <code>How to make the word invisible when it's checked without js</code> &lt;---- this is title is what I am getting in my sheet. What I want to get is this title's holding a <code>href</code> link <code>/questions/51509457/how-to-make-the-word-invisible-when-its-checked-without-js</code> this is what I want to get and navigate through my code.</p>
  
  <p>Please help me out. Thanks in advance</p>
  
  <p>Below are the entire coding:</p>
  
  <pre><code>Sub useClassnames()
      Dim element As IHTMLElement
      Dim elements As IHTMLElementCollection
      Dim ie As InternetExplorer
      Dim html As HTMLDocument
  
      'open Internet Explorer in memory, and go to website
      Set ie = New InternetExplorer
      ie.Visible = True
      ie.navigate "https://stackoverflow.com/questions"
      'Wait until IE has loaded the web page
  
      Do While ie.readyState &lt;&gt; READYSTATE_COMPLETE
          DoEvents
      Loop
  
      Set html = ie.document
      Set elements = html.getElementsByClassName("question-hyperlink")
  
      Dim count As Long
      Dim erow As Long
      count = 0
  
      For Each element In elements
          If element.className = "question-hyperlink" Then
              erow = Sheets("Exec").Cells(Rows.count, 1).End(xlUp).Offset(1, 0).Row
              Sheets("Exec").Cells(erow, 1) = html.getElementsByClassName("question-hyperlink")(count).innerText
              count = count + 1
          End If
      Next element
  
      Range("H10").Select
  End Sub
  </code></pre>
  
  <p>I cant find any answer in this website asked by anyone. Please don't suggest this question as duplicate.</p>
  
  <pre><code>&lt;div class="row hoverSensitive"&gt;
          &lt;div class="column summary-column summary-column-icon-compact  "&gt;
                                  &lt;img src="images/app/run32.png" alt="" width="32" height="32"&gt;
                          &lt;/div&gt;
          &lt;div class="column summary-column  "&gt;
              &lt;div class="summary-title summary-title-compact text-ppp"&gt;
                                          &lt;a href="**index.php?/runs/view/7552**"&gt;MMDA&lt;/a&gt;
  
              &lt;/div&gt;
              &lt;div class="summary-description-compact text-secondary text-ppp"&gt;
                                                                              By on 7/9/2018                                                  &lt;/div&gt;
          &lt;/div&gt;      
          &lt;div class="column summary-column summary-column-bar  "&gt;
                              &lt;div class="table"&gt;
  &lt;div class="column"&gt;
      &lt;div class="chart-bar "&gt;
                                                                                                                          &lt;div class="chart-bar-custom link-tooltip" tooltip-position="left" style="background: #4dba0f; width: 125px" tooltip-text="100% Passed (11/11 tests)"&gt;&lt;/div&gt;
                                                                                                                                                                                                                                                                                                                                                                                                              &lt;/div&gt;
  &lt;/div&gt;
      &lt;div class="column chart-bar-percent chart-bar-percent-compact"&gt;
      100%'
  </code></pre>