I am new to VBA coding. I want some data from NSE-Company tracker websites. I tried using below code
Please Use below Scrip code at Place of R: MANAPPURAM, PDSMFL, MINDACORP, CIGNITITEC, SHEMAROO, SUPERHOUSE, SHARDACROP, SNOWMAN, SBIN
While I am executing above code, VBA is pasting only data for first Scrip and sometimes it is showing debug error at copy paste code. If I am debugging macro manually(using F8 key) it is correctly executing the procedure. I have also used ReadyState Property to Webdata load but its not working.
I wanted to copy and paste the data for all scrip (one by one) into excel.
Please help me to scrap the data from the website into excel.
Document Link is here:
Code:
[COLOR=#555555]Private Sub IE_Automation()[/COLOR]
<code style="margin: 0px; padding: 0px;">Dim R As Long
Dim IE As Object
Dim ieurl As String
Set IE = CreateObject("internetexplorer.application")
IE.Visible = True 'internet explorer run command
For *R = 2 To 10*
ieurl = "http://www.nseindia.com/companytracker/cmtracker.jsp?symbol=" & Sheets("Sheet1").Cells(*R*, 1)
IE.navigate ieurl 'internet url
Do
DoEvents
Loop While IE.Busy
IE.ExecWB 17, 2 'IE page selection command
IE.ExecWB 12, 0 'IE page copy command
Range("A2").Select
Sheets("Sheet2").PasteSpecial Format:="Text", Link:=False, DisplayAsIcon:= _
False 'IE page data paste command in excel
Next R
</code>[COLOR=#555555]End Sub[/COLOR]
Please Use below Scrip code at Place of R: MANAPPURAM, PDSMFL, MINDACORP, CIGNITITEC, SHEMAROO, SUPERHOUSE, SHARDACROP, SNOWMAN, SBIN
While I am executing above code, VBA is pasting only data for first Scrip and sometimes it is showing debug error at copy paste code. If I am debugging macro manually(using F8 key) it is correctly executing the procedure. I have also used ReadyState Property to Webdata load but its not working.
I wanted to copy and paste the data for all scrip (one by one) into excel.
Please help me to scrap the data from the website into excel.
Document Link is here:
HTML:
http://www.mediafire.com/download/pzbov8m58jbtmxz/web+scraping.xlsm