Excel web query help

yeayeah06

New Member
Joined
Jul 10, 2011
Messages
1
im new to vba and have been trying to make a macro that inputs the data value from column A into the website emma.msrb.org and take the data table from the vrdo tab on the site. I then need it to take only the most recent interest rate from the table and the date and want it to then put this data in column B&C. This macro also needs to loop through all of column a and repeat this until nothing is left.

This is what i sort of stole from other scripts and modded for mine, but its not really what i want.

Sub Get_Nyse_Data() Dim C As Range Dim strName As String Dim strConnectString Dim QT As QueryTable On Error Resume Next

For Each C In Selection strName = C.Value strConnectString = _ "URL;http://emma.msrb.org/SecurityView/SecurityDetailsVRDO.aspx?cusip=" & C.Value ThisWorkbook.Worksheets.Add ActiveSheet.Name = strName

With QT .Name = strName .FieldNames = True .RowNumbers = False .FillAdjacentFormulas = False .PreserveFormatting = True .RefreshOnFileOpen = False .BackgroundQuery = True .RefreshStyle = xlInsertDeleteCells .SavePassword = False .SaveData = True .AdjustColumnWidth = True .RefreshPeriod = 0 .WebSelectionType = xlEntirePage .WebFormatting = xlWebFormattingNone .WebPreFormattedTextToColumns = True .WebConsecutiveDelimitersAsOne = True .WebSingleBlockTextImport = False .WebDisableDateRecognition = False .WebDisableRedirections = False .Refresh BackgroundQuery:=False End With

' On the Workspace worksheet, 'clear all existing query tables For Each QT In ActiveSheet.QueryTables QT.Delete Next QT

' Define a new Web Query Set QT = ActiveSheet.QueryTables.Add _ (Connection:=strConnectString, Destination:=Range("B1")) Application.Run "BLPLinkReset"

' Refresh the Query QT.Refresh BackgroundQuery:=True

Next End Sub
 

Excel Facts

Move date out one month or year
Use =EDATE(A2,1) for one month later. Use EDATE(A2,12) for one year later.

Forum statistics

Threads
1,224,541
Messages
6,179,418
Members
452,912
Latest member
alicemil

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top