A 'do while' loop macro in Excel 2007These macros perform the calculations in Excel as long as the defined conditions are met. In our example shown below we wish to calculate 'other benefits' and the 'total' amount of money that a employee receives as long as the 'name' of the employee under the 'name' heading has been input. As soon as the program encounters a 'no data' cell it stops the calculations as desired. Of course you can define different conditions based on the calculation requirements of your problem and perform more difficult calculations. As you can see apart from the understanding of the logic and the syntax used to create a macro in Visual Basic for Applications (VBA) you need to have a sound knowledge of the domain in which you are working! The training video below demonstrates the idea. |