Import just one cell of this table [closed]
up vote
0
down vote
favorite
I have find the solution to extract table of the website, But i am stuck to draw one cell instead whole table. Help me.
Here is the code.
Public Sub GetTable()
Dim sResponse As String, html As HTMLDocument, clipboard As Object, ws As Worksheet
Set ws = ThisWorkbook.Worksheets("Sheet1")
Set clipboard = GetObject("New:{1C3B4210-F441-11CE-B9EA-00AA006B1A69}")
With CreateObject("MSXML2.XMLHTTP")
.Open "GET", "https://www.nseindia.com/live_market/dynaContent/live_watch/get_quote/getHistoricalData.jsp?symbol=FEL&series=EQ&fromDate=undefined&toDate=undefined&datePeriod=3months", False
.setRequestHeader "If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT"
.send
sResponse = StrConv(.responseBody, vbUnicode)
End With
Set html = New HTMLDocument
html.body.innerHTML = sResponse
clipboard.SetText html.querySelector("table").outerHTML
clipboard.PutInClipboard
ws.Cells(1, 1).PasteSpecial
End Sub
microsoft-excel vba
closed as too broad by Máté Juhász, PeterH, Pimp Juice IT, K7AAY, DrMoishe Pippik Dec 9 at 3:35
Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
add a comment |
up vote
0
down vote
favorite
I have find the solution to extract table of the website, But i am stuck to draw one cell instead whole table. Help me.
Here is the code.
Public Sub GetTable()
Dim sResponse As String, html As HTMLDocument, clipboard As Object, ws As Worksheet
Set ws = ThisWorkbook.Worksheets("Sheet1")
Set clipboard = GetObject("New:{1C3B4210-F441-11CE-B9EA-00AA006B1A69}")
With CreateObject("MSXML2.XMLHTTP")
.Open "GET", "https://www.nseindia.com/live_market/dynaContent/live_watch/get_quote/getHistoricalData.jsp?symbol=FEL&series=EQ&fromDate=undefined&toDate=undefined&datePeriod=3months", False
.setRequestHeader "If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT"
.send
sResponse = StrConv(.responseBody, vbUnicode)
End With
Set html = New HTMLDocument
html.body.innerHTML = sResponse
clipboard.SetText html.querySelector("table").outerHTML
clipboard.PutInClipboard
ws.Cells(1, 1).PasteSpecial
End Sub
microsoft-excel vba
closed as too broad by Máté Juhász, PeterH, Pimp Juice IT, K7AAY, DrMoishe Pippik Dec 9 at 3:35
Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
1
What you've tried to solve your problem? Which cell you want to fill? How the macro should decide it?...
– Máté Juhász
Dec 3 at 13:52
I want to fill the cell with date 03 September. It is under "td" under "tr".
– Jugal Kishor
Dec 3 at 13:56
1
I don't think it's possible to select what you want to paste from the clipboard. You need to paste everything, than delete what's not needed. (Or paste everything to a new, temporary sheet, copy the important content to the old sheet, and delete the temporary sheet. )
– Máté Juhász
Dec 3 at 14:05
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have find the solution to extract table of the website, But i am stuck to draw one cell instead whole table. Help me.
Here is the code.
Public Sub GetTable()
Dim sResponse As String, html As HTMLDocument, clipboard As Object, ws As Worksheet
Set ws = ThisWorkbook.Worksheets("Sheet1")
Set clipboard = GetObject("New:{1C3B4210-F441-11CE-B9EA-00AA006B1A69}")
With CreateObject("MSXML2.XMLHTTP")
.Open "GET", "https://www.nseindia.com/live_market/dynaContent/live_watch/get_quote/getHistoricalData.jsp?symbol=FEL&series=EQ&fromDate=undefined&toDate=undefined&datePeriod=3months", False
.setRequestHeader "If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT"
.send
sResponse = StrConv(.responseBody, vbUnicode)
End With
Set html = New HTMLDocument
html.body.innerHTML = sResponse
clipboard.SetText html.querySelector("table").outerHTML
clipboard.PutInClipboard
ws.Cells(1, 1).PasteSpecial
End Sub
microsoft-excel vba
I have find the solution to extract table of the website, But i am stuck to draw one cell instead whole table. Help me.
Here is the code.
Public Sub GetTable()
Dim sResponse As String, html As HTMLDocument, clipboard As Object, ws As Worksheet
Set ws = ThisWorkbook.Worksheets("Sheet1")
Set clipboard = GetObject("New:{1C3B4210-F441-11CE-B9EA-00AA006B1A69}")
With CreateObject("MSXML2.XMLHTTP")
.Open "GET", "https://www.nseindia.com/live_market/dynaContent/live_watch/get_quote/getHistoricalData.jsp?symbol=FEL&series=EQ&fromDate=undefined&toDate=undefined&datePeriod=3months", False
.setRequestHeader "If-Modified-Since", "Sat, 1 Jan 2000 00:00:00 GMT"
.send
sResponse = StrConv(.responseBody, vbUnicode)
End With
Set html = New HTMLDocument
html.body.innerHTML = sResponse
clipboard.SetText html.querySelector("table").outerHTML
clipboard.PutInClipboard
ws.Cells(1, 1).PasteSpecial
End Sub
microsoft-excel vba
microsoft-excel vba
asked Dec 3 at 13:28
Jugal Kishor
1
1
closed as too broad by Máté Juhász, PeterH, Pimp Juice IT, K7AAY, DrMoishe Pippik Dec 9 at 3:35
Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
closed as too broad by Máté Juhász, PeterH, Pimp Juice IT, K7AAY, DrMoishe Pippik Dec 9 at 3:35
Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
1
What you've tried to solve your problem? Which cell you want to fill? How the macro should decide it?...
– Máté Juhász
Dec 3 at 13:52
I want to fill the cell with date 03 September. It is under "td" under "tr".
– Jugal Kishor
Dec 3 at 13:56
1
I don't think it's possible to select what you want to paste from the clipboard. You need to paste everything, than delete what's not needed. (Or paste everything to a new, temporary sheet, copy the important content to the old sheet, and delete the temporary sheet. )
– Máté Juhász
Dec 3 at 14:05
add a comment |
1
What you've tried to solve your problem? Which cell you want to fill? How the macro should decide it?...
– Máté Juhász
Dec 3 at 13:52
I want to fill the cell with date 03 September. It is under "td" under "tr".
– Jugal Kishor
Dec 3 at 13:56
1
I don't think it's possible to select what you want to paste from the clipboard. You need to paste everything, than delete what's not needed. (Or paste everything to a new, temporary sheet, copy the important content to the old sheet, and delete the temporary sheet. )
– Máté Juhász
Dec 3 at 14:05
1
1
What you've tried to solve your problem? Which cell you want to fill? How the macro should decide it?...
– Máté Juhász
Dec 3 at 13:52
What you've tried to solve your problem? Which cell you want to fill? How the macro should decide it?...
– Máté Juhász
Dec 3 at 13:52
I want to fill the cell with date 03 September. It is under "td" under "tr".
– Jugal Kishor
Dec 3 at 13:56
I want to fill the cell with date 03 September. It is under "td" under "tr".
– Jugal Kishor
Dec 3 at 13:56
1
1
I don't think it's possible to select what you want to paste from the clipboard. You need to paste everything, than delete what's not needed. (Or paste everything to a new, temporary sheet, copy the important content to the old sheet, and delete the temporary sheet. )
– Máté Juhász
Dec 3 at 14:05
I don't think it's possible to select what you want to paste from the clipboard. You need to paste everything, than delete what's not needed. (Or paste everything to a new, temporary sheet, copy the important content to the old sheet, and delete the temporary sheet. )
– Máté Juhász
Dec 3 at 14:05
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
1
What you've tried to solve your problem? Which cell you want to fill? How the macro should decide it?...
– Máté Juhász
Dec 3 at 13:52
I want to fill the cell with date 03 September. It is under "td" under "tr".
– Jugal Kishor
Dec 3 at 13:56
1
I don't think it's possible to select what you want to paste from the clipboard. You need to paste everything, than delete what's not needed. (Or paste everything to a new, temporary sheet, copy the important content to the old sheet, and delete the temporary sheet. )
– Máté Juhász
Dec 3 at 14:05