Microsoft Excel PowerLesson 1: The basics of Macros.Conclusion
We have covered quite a lot and I hope that you will agree that it was not too difficult. There may be parts of what we have done that still seem a little mysterious, but that will change as we progress through the lessons. You will be surprised at how quickly you gain confidence to try things in macros. Now you may be thinking that you will never remember all of the code that you use, well, you don't have to, you just need to know how to find out what to use. For example, I mention in one of the lines of generated code that we set the ColumnWidth property of the Column object; you may be saying to yourself "I don't know the properties of the Column object, how can I ever program a macro?" Well, I don't know them all either, but what I do is to perform the step manually while recording the key strokes with the macro recorder. I then have a small macro that has the relevant bit of code. I thus have the necessary statements to use in my own macro. This is the general approach to take - Determine your goal; break it down to the individual steps; record the relevant bits of code, and then put them all together into one macro that will achieve your goal. This can get pretty sophisticated, but with practice you will get very good at this. One last point that concerns running macros; you have to set the security level such that the system will allow you to run a macro. |