THIS IS ALL THE HINTS THAT HE GAVE US:
BUSI 4502 – Investment Management
Creating a 1% Filter Test macro in MS Excel
Having trouble sorting through massive amounts of data? This document should
provide some helpful hints for programming a 1% filter macro in Microsoft
Excel. With any luck, taking these steps into consideration, you should be
able to complete what’s required for the assignment.
First off, open your data file. The idea is you want to manipulate a large
quantity of data. You need to create a macro for this.
In Excel, go to the Tools menu, and select “Record New Macroâ€. A popup
box will appear, asking you for information. You can call the macro whatever
you wish, for example ‘FilterTest’. Give it a shortcut command (e.g. Ctrl +
F). This is the keyboard command you’ll use to activate the macro when you’re
finished creating it.
When you click on “Okâ€, the macro will automatically start “recordingâ€. It
will remember your movements and actions you perform (e.g. clicking on
certain cells, sorting data, doing calculations), so remember to have a plan
before you start recording, otherwise the macro won’t work out properly.
For example, your first data entry will be considered your ‘low’ price, and
will be compared to your second data entry, as shown to the right. The second
price is 1.42% lower than the previous price, and is considered the new low.
If you did this calculation while recording the macro, click on the next cell
down (e.g. H4) and stop recording. You can go to the Tools menu, Macro, and
click on “Stop recordingâ€.
Now that your macro is created, you can “start†it by using the keyboard
command. But don’t do that just yet. You still need to add some more commands
– you need to decide if you’re ready to buy or if you’ve already bought in,
when to sell. Click on the Tools menu again, Macro, and the “Macro†command.
This will list all of the macros created in the excel document. Click on the
one you just made, and click on the Edit button. You should see a Visual
Basic coding window popup, similar to the one below. Enter in the
appropriate code, and your filter will be complete! Remember to run the macro
when you’re finished! Good luck!