The Game of Life

The Game of Life is an old programmer’s puzzle that teaches teenagers to write and analyse their own code. The goal of the game is to simulate the development (life and death) of cells within one organism. An organism is a matrix of arbitrary size, and the rules are as follows: if a cell is alive and surrounded by 2 or 3 living cells, it will survive. If there is an empty position and is surrounded by 3 living cells, a new cell will be born. How to create this simulation in Excel?

Events

Running the VBA program is most often initiated by an event. Events can be on the document-level (eg Open, Activate), worksheet (eg Calculate, Change), charts, applications, forms … The event that starts the subroutine is mainly a click on a button or object, object focus or change the content of the object. Some events are executed automatically after opening an existing or creating a new document …

VBA filtering

Filters are a very useful functionality that enables us to filter content in the table or area above which the autofilter was previously used based on a given criterion. This can be accomplished in many ways, but there is always an event that we are launching to perform the action. In this “recipe” you will learn how to filter the table with the help of previously prepared, combo lists.

Coloring the content

Colors help us to emphasize the contents of the worksheet, and the VBA allows you to do so through the code. You can change the colors of the font, background or cell border. This can be done in several ways: by specifying a VBA constant representing color, by typing a color code or by specifying a RGB color combination using the same name function …

VBA and comments

Comments in Excel are a convenient way to leave notes about the results of the calculations you made or otherwise explain your work within the worksheet. VBA allows you to easily add and delete comments. The following text will describe how to create programs by which you add or delete comments from within an active cell.