Hello,
I am trying to pull current market data (bond rates) into excel from the below link:
https://rates.chathamfinancial.com/us-market/rates
In short, I am trying to pull the rates for each respective term in the 'Current' column as per the highlighted below. I have been able to do this using excel's data scraper tool and using vlookups but I am pretty sure there is a better way (more accurate/consistent) to do this via VBA.
<header _ngcontent-c7="" class="rates-table__header" style="font-family: "PT Sans", Helvetica, Arial, sans-serif; box-sizing: border-box; display: flex; place-content: center; flex-direction: column; height: 30px; width: 606px; padding-left: 10px; margin: 0px; background-color: rgb(126, 126, 126); color: rgb(65, 65, 65); font-size: 16px;">[h=1]US TREASURIES[/h]</header>[FONT="][TABLE="class: rates-table__table ng-star-inserted, width: 606"]
<thead _ngcontent-c7="" style="box-sizing: border-box;">[TR]
[TH="class: label, align: left"] [/TH]
[TH="class: current, align: left"]Current[/TH]
[TH="align: left"]1 Day Ago[/TH]
[TH="align: left"]1 Mo. Ago[/TH]
[TH="align: left"]1 Year Ago[/TH]
[/TR]
</thead><tbody _ngcontent-c7="" class="ng-star-inserted" style="box-sizing: border-box; padding: 10px;">[TR]
[TD="class: label"]1 Year[/TD]
[TD="class: current"]2.620%[/TD]
[TD]2.645%[/TD]
[TD]2.572%[/TD]
[TD]1.417%[/TD]
[/TR]
[TR]
[TD="class: label"]2 Year[/TD]
[TD="class: current"]2.837%[/TD]
[TD]2.877%[/TD]
[TD]2.815%[/TD]
[TD]1.583%[/TD]
[/TR]
[TR]
[TD="class: label"]3 Year[/TD]
[TD="class: current"]2.890%[/TD]
[TD]2.954%[/TD]
[TD]2.898%[/TD]
[TD]1.727%[/TD]
[/TR]
[TR]
[TD="class: label"]5 Year[/TD]
[TD="class: current"]2.944%[/TD]
[TD]3.011%[/TD]
[TD]2.963%[/TD]
[TD]2.042%[/TD]
[/TR]
[TR]
[TD="class: label"]7 Year[/TD]
[TD="class: current"]3.031%[/TD]
[TD]3.099%[/TD]
[TD]3.041%[/TD]
[TD]2.256%[/TD]
[/TR]
[TR]
[TD="class: label"]10 Year[/TD]
[TD="class: current"]3.108%[/TD]
[TD]3.169%[/TD]
[TD]3.082%[/TD]
[TD]2.415%[/TD]
[/TR]
[TR="class: rates-table___row--hide-mobile"]
[TD="class: label"]15 Year[/TD]
[TD]–[/TD]
[TD]–[/TD]
[TD]–[/TD]
[TD]–[/TD]
[/TR]
[TR]
[TD="class: label"]30 Year[/TD]
[TD="class: current"]3.334%[/TD]
[TD]3.367%[/TD]
[TD]3.218%[/TD]
[TD]2.923%[/TD]
[/TR]
</tbody>[/TABLE]
[/FONT]
Any help would be appreciated!
I am trying to pull current market data (bond rates) into excel from the below link:
https://rates.chathamfinancial.com/us-market/rates
In short, I am trying to pull the rates for each respective term in the 'Current' column as per the highlighted below. I have been able to do this using excel's data scraper tool and using vlookups but I am pretty sure there is a better way (more accurate/consistent) to do this via VBA.
<header _ngcontent-c7="" class="rates-table__header" style="font-family: "PT Sans", Helvetica, Arial, sans-serif; box-sizing: border-box; display: flex; place-content: center; flex-direction: column; height: 30px; width: 606px; padding-left: 10px; margin: 0px; background-color: rgb(126, 126, 126); color: rgb(65, 65, 65); font-size: 16px;">[h=1]US TREASURIES[/h]</header>[FONT="][TABLE="class: rates-table__table ng-star-inserted, width: 606"]
<thead _ngcontent-c7="" style="box-sizing: border-box;">[TR]
[TH="class: label, align: left"] [/TH]
[TH="class: current, align: left"]Current[/TH]
[TH="align: left"]1 Day Ago[/TH]
[TH="align: left"]1 Mo. Ago[/TH]
[TH="align: left"]1 Year Ago[/TH]
[/TR]
</thead><tbody _ngcontent-c7="" class="ng-star-inserted" style="box-sizing: border-box; padding: 10px;">[TR]
[TD="class: label"]1 Year[/TD]
[TD="class: current"]2.620%[/TD]
[TD]2.645%[/TD]
[TD]2.572%[/TD]
[TD]1.417%[/TD]
[/TR]
[TR]
[TD="class: label"]2 Year[/TD]
[TD="class: current"]2.837%[/TD]
[TD]2.877%[/TD]
[TD]2.815%[/TD]
[TD]1.583%[/TD]
[/TR]
[TR]
[TD="class: label"]3 Year[/TD]
[TD="class: current"]2.890%[/TD]
[TD]2.954%[/TD]
[TD]2.898%[/TD]
[TD]1.727%[/TD]
[/TR]
[TR]
[TD="class: label"]5 Year[/TD]
[TD="class: current"]2.944%[/TD]
[TD]3.011%[/TD]
[TD]2.963%[/TD]
[TD]2.042%[/TD]
[/TR]
[TR]
[TD="class: label"]7 Year[/TD]
[TD="class: current"]3.031%[/TD]
[TD]3.099%[/TD]
[TD]3.041%[/TD]
[TD]2.256%[/TD]
[/TR]
[TR]
[TD="class: label"]10 Year[/TD]
[TD="class: current"]3.108%[/TD]
[TD]3.169%[/TD]
[TD]3.082%[/TD]
[TD]2.415%[/TD]
[/TR]
[TR="class: rates-table___row--hide-mobile"]
[TD="class: label"]15 Year[/TD]
[TD]–[/TD]
[TD]–[/TD]
[TD]–[/TD]
[TD]–[/TD]
[/TR]
[TR]
[TD="class: label"]30 Year[/TD]
[TD="class: current"]3.334%[/TD]
[TD]3.367%[/TD]
[TD]3.218%[/TD]
[TD]2.923%[/TD]
[/TR]
</tbody>[/TABLE]
[/FONT]