

Login to the website with your Microsoft 365 account, launch Excel for the Web, and start a blank workbook.įrom here, you can record your actions, view your scripts, or try out some pre-recorded scripts. Remember, Office Scripts are only available when using Excel (or other Office 365 applications) on the Web. If you are interested in learning how to write VBA code like the example above, check out my full VBA course on the XelPlus website. The branching logic, process looping, and user prompts are too complex and require hand-crafted code to operate properly. Unlike the simple VBA macro example, this solution can’t be created using the Macro Recorder. The logic is not confined to a predetermined linear path. This makes for a highly dynamic environment where the output can be different from use to use. The macros can perform tasks in a variety of order and purpose. The user clicks code launch buttons to execute specific tasks in any order they choose. VBA Macros can be as simple or as complex as you need them to be.īelow is an example of a set of macros that solicit the user for a data file, create a report based on the user’s needed topic, export the results a data file or PDF, etc. More exotic users may even assign macros to shapes, images, or icons that when clicked will execute the macro.

Macros can be launched in a variety of methods: If you are interested in learning how this was made, click the following link for a complete, step-by-step tutorial and video on the construction of the macro and chart. This macro is showcased in a previous post/video.

It did require a small amount of hand-coding to dynamically determine the data range, but the vast majority was created without needing any knowledge of the VBA language. This tool writes the VBA code for us based on observing which buttons are pushed and what data is selected. The macro was written in such a way that it can dynamically detect the number of rows in the data and build the chart accordingly.Ĭreating the macro was done using a tool called the Macro Recorder. The chart was created from the dataset using a pre-recorded VBA macro.
