title: Extract Table from Webpage in Excel using VBA
body: <p>How to Extract Below table in Excel from Webpage?</p>
  
  <p>Table</p>
  
  <p>Company | Bonus Ratio |Announcement|Record|Ex-Bonus</p>
  
  <pre><code>Codes
  Dim ie As SHDocVw.InternetExplorer
  Set ie = New InternetExplorerMedium
  Set ie = CreateObject("InternetExplorer.Application")
   While ie.busy
   DoEvents
   Wend
   ie.Visible = True
   While ie.busy
   DoEvents
   Wend
  Dim NavURL As String
  NavURL = "https://www.moneycontrol.com/stocks/marketinfo/bonus/homebody.php?sel_year=2015"
  
  ie.Navigate NavURL
   While ie.busy
   DoEvents
   Wend
   Set doc = ie.document
   Set hTable = doc.GetElementsByTagName("table")
  
  
   y = 2 'Column B in Excel
   z = 7 'Row 7 in Excel
   For Each td In hTable
   Set hHead = tb.GetElementsByTagName("td")
   For Each hh In hHead
   Set hTR = hh.GetElementsByTagName("tr")
   For Each tr In hTR
  </code></pre>
  
  <p>Webpage: <a href="https://www.moneycontrol.com/stocks/marketinfo/bonus/homebody.php?sel_year=2015" rel="nofollow noreferrer">https://www.moneycontrol.com/stocks/marketinfo/bonus/homebody.php?sel_year=2015</a></p>
  
  <p>by Keeping Bonus Ratio as Same as on Webpage or Text Format
  While copy it in Excel, Bonus Ratio Converts to Decimal</p>