EPF.Yahooso they can be easily referenced.
Yahoo Finance provides data from many different exchanges, some are real-time (such as the NYSE and NASDAQ) whilst others are delayed. For full details of coverage refer to Exchanges and data providers on Yahoo Finance on the Yahoo Finance website.
||Current mid price.|
||Change in price today.|
||Percentage change in price today.|
||Volume of shares traded today.|
||Current market capitalisation.|
||52 week high.|
||52 week low.|
||PE Ratio TTM (Trailing Twelve Months)|
||EPS TTM (Trailing Twelve Months)|
||Market open price.|
||Previous market close price.|
||Quote type, for example "EQUITY" or "MUTUALFUND".|
||Populate the Excel cell with the current stock price of Apple.|
||Populate the Excel cell with the current daily volume of Microsoft.|
||Populate the Excel cell with the 52 week high price of the Vanguard 500 Index Mutual Fund.|
All of the Yahoo Finance data which is available via Excel Formulas can also be accessed in VBA via a set of VBA functions. They all begin with EPF.Yahoo.VBA and can be used for market analysis, automated trading etc.
The list below is all the functions that can be called from VBA, see above for descriptions.
1. Return the live price of Microsoft stock:
Dim price As Variant
price = Application.Run("EPF.Yahoo.VBA.Price", "MSFT")
2. Return the day high price of Apple stock:
Dim bidPrice As Variant
bidPrice = Application.Run("EPF.Yahoo.VBA.DayHigh", "AAPL")
3. Sample Code for Apple stock quote and 52 week high in Excel VBA: