How do I open a web page with VBA
Here is the web page.
https://marketdata.theocc.com/stock-...eName=20200721
The last digits will change daily representing yesterday's date (YYYYMMDD).
I will use cell references to change the date.
Any thoughts?
Here is some code that i have so far...
Sub OCC_eligible()
Dim yCellday As Long
Dim Cellmonth As Long
Dim Cellyear As Long
Dim rc As Worksheet
Dim occ As Worksheet
Set rc = Workbooks("Rate Calculator (VBA)").Worksheets("Back-end")
Set occ = Workbooks("Rate Calculator (VBA)").Worksheets("Hedge Eligibility Paste")
Sheets("Hedge Eligibility Paste").Select
Selection.ClearContents
yCellday = rc.Range("M12").Value
Cellmonth = rc.Range("K13").Value
Cellyear = rc.Range("O11").Value
Workbooks.Open "C:\Users\ja\Downloads\stockloaneligiblesecurities" & Format(Cellyear, "0000") & Format(Cellmonth, "00") & Format(yCellday, "00") & ".CSV"
Sheets("stockloaneligiblesecurities" & Format(Cellyear, "0000")).Select
ActiveSheet.Cells.Select
Selection.Copy
occ.PasteSpecial
ActiveWorkbook.Application.CutCopyMode = False
ActiveWorkbook.Close savechanges:=False
Workbooks("Rate Calculator (VBA)").Save
Sheets("Rate Auto Calc").Select
MsgBox "OCC's Hedge Eligible list has been updated."
End Sub
Bookmarks