Demo of vf_GetHistory function part of an Excel add-in example posted on http://vbafin.com/Price-Functions.php - Visual Basic for Financial Professionals web site. The function returns Historical Prices (Date and one of the following: Open, High, Low, Volume, Close, Adj Close) or Dividends (Ex Date and Dividend Amount). Data sourced from Yahoo Finance.
The easiest (not necessary the best) way is to change the line
TempArray(r, 2) = Temp(1)
in Function ReadCsvFile, Module pxFunctions with the following:
If UBound(Temp) > 5 Then TempArray(r, 2) = Temp(6)
Else TempArray(r, 2) = Temp(1)
End If
I'll be making some changes to the add-in and update the site in the next few weeks that will incorporate a better solution for you.
vbafin 1 year ago
Does anyone know how to obtain close data rather than open data from the .csv file?? thanks
onedave1985 1 year ago