Excel VBA scripting on stock market data.
Contents:
/code - contains VBA code to summarize stock ticker data
/data - contains Excel data to test code on (note contains 100+MB of data)
/images - contains screenshots of solution in Excel
Directions: This submission solves the Hard Challenge level. Copy the macro code over to Excel and run the HardChallenge() macro to test the solution.
Additionally, this project uses VBA scripting in Excel to summarize sample stock market data according to three different levels:
- Easy - Returns the following using Easy(), EasyChallenge() macros:
- Moderate - Returns the following using Moderate(), ModerateChallenge() macros:
- stock ticker symbol
- yearly change from opening price at the beginning of a given year to the closing price at the end of that year
- percent change from opening price at the beginning of a given year to the closing price at the end of that year
- total stock volume per ticker
NOTE: if any stock contains opening price of 0, then the percent change is defaulted to NULL value in the corresponding sumamry cell since we cannot divide by 0
- Hard - Returns the following using Hard(), HardChallenge() macros:
Also note that there are "Clear[SolutionLevel
]()" macros included to easily clear out cells and formatting for a clean re-run of VBA summary scripts if needed.
The *Challenge() macros loop through each sheet in the Excel workbook and applies the solution to every sheet.