(1) You need a Microsoft Office Excel Macro-Enabled Worksheet (.xlsm). You can create one by saving an excel file "Save as" Macro-Enabled Worksheet. (Your Example Worksheet appeared to be an Excel Macro-Enabled Worksheet.)
(2) Your Macro-Enabled Worksheet needs to be in a folder which you can designate was macro friendly. The way you do this: click on the Office Button -> Excel Options -> Trust Center -> Trust Center Setting -> Trusted Locations. Then you add your folder (where you have your Excel Macro-Enabled Worksheet) as a trusted location.
(3) With your Excel Macro-Enabled Worksheet go to the menu item "Developer" -> Visual Basic.
(4) In the VBE (Visual Basic Editor), go to Tools -> Options and click the "Editor" tab and check the box next to "Require Variable Declarations" (if not checked). (This is not necessary, but good practice. Only needs to be done once.)
(5) From the menu: Insert -> Module; a module should open to the right with "Option Explicit" (in blue type).
(6) Copy and paste the following under "Option Explicit":
(7a) With your "Example" worksheet active, go to the menu: "Developer" -> Macros. I popup box should now show the macro: "UpDatePrices", click and run.
(7b) Or with your "Example" worksheet active, go to the menu: "Developer" -> Visual Basic, click inside the macro in the module and press F8. Repeat F8 while you step through the code. (Play around with it.)
If you get stuck on a step, just ask.
Bookmarks