Dynamic Macros #1

Hi everybody,

Today we’ll talk about dynamic macros very useful in engineering modeling, scientific modeling, games etc. Dynamic macros are created using two different type of loops: “For” and “Do”.
– Two different but equivalent conditional “Do” loops are explored.
– It is shown that macros can be assigned to drawing shapes, pictures, graph, etc.
– A highly valuable Run/Pause macro is described and implemented. The reader must pay close attention to this presentation. In order to create science, engineering models, or games in Excel one needs to know these techniques well.

This article has 4 Comments

  1. Dear George,
    thanks a lot for this topic. Everything works fine. It’s a wonderful educational tool, I found a lot of new things here. Thanks for your great job !

  2. Vlad, the first 4 macros are designed to run up to 1000 and then stop by themselves. You can only stop them in the middle by holding Escape or from the VBA editor hit the square “Stop” button. The ONLY macro that can be paused and restart from the same button is the very last one. The first four loops are supposed to crash if you hit Loop while running.The way they are written there is no other way. The tutorial builds up knowledge of regular loop and at the end it shows you a really good one which you should always use if you want to save buttons.
    About the speed I cannot answer. Microsoft dropped the ball here. I personally stay away from those versions. Most of the performance drop might come from charting.
    Thanks for the notice. George

  3. Dear George, after testing of Dynamic Macros #1 in three versions of Excel (2003, 2007 and 2010) I found the following:
    1) The program accidentally shuts down when I occasionally click twice on Loop1 label. The same happened with the rest of labels – Loop 2/ Loop3/ Loop4 when I intentionally clicked on them several times.
    2) It’s impossible to stop any Loop correctly by clicking on Run/Stop label. It just does not stop, and when I try it again by clicking on Run/Stop – the program shuts down.
    3) Of course, this is not a news for you, comparing the speed of all three versions of Excel the 2003 is an incomparable champion..2007 and 2010 are real losers. The difference in speed is tremendous. Do you know why ?
    Thanks for your attention.

Comments are closed.