Viewing the VBA Code

help-meVisual Basic (VBA) and Macro codes are in files not normally available to the everyday Microsoft Excel user. But it is fairly easy to get to view them provided that there is no password, or similar protection. All the freely downloadable worksheets on the Accountancy Templates website are password protected where there are Macros or other VBA code.

If you have purchased the password free version then follow this simple method to view the code behind the Macro buttons;

– using a mouse right click on the macro button

– on the drop-down menu, click on ‘Assign Macro’ option

– select the macro you wish to view or amend

– click on ‘Edit’

The Visual Basic for Applications window appears showing the Macro you selected. Click the x in the top right of the window to close the VBA module.

Warning – Changing the VBA in this window is instant – there are no “are you sure?” questions before the new code is admitted to the sequence. Best practice is to always work on a copy file and keep your original to revert to if things go wrong!

However, having taken all the precautions, try changing some code and re-running the macro to see the effects.  Beware you could get hooked into VBA writing very easily. But if it all gets a bit beyond you, then our VBA Consultancy service is here help.