Question Locked

excel macros

0 helpful
4 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.
can anyone help me to understand how to write simple macros in exel 2007?

4 replies

by thumbsup2

There are many books written to help you learn Visual Basic. But, if you want to learn using the built in help, here's how to start.

Open a new blank workbook. Click Tools/Macros/Record New Macro. Click OK. A toolbar will appear. Now, select any cell and type something into it. Select another cell and type something else into it. Now, on the toolbar that recently appeared, click the little square (stop). The new toolbar will disappear. Now, click Tools/Macros/Macro ... in the window that opens, your new macro will be selected. Click Edit. That opens up the VB Editor. You can see the code created when it was recording your movements/typing. From there, there is extensive built in help in the program. Start at the beginning and continue to experiment, learning as you go.

by ams

Can you recommend a book - I'm on my way out top the library?

by thumbsup2

I haven't read any of them. I learn by trial and error, mostly the latter. :( Those are called the "Ahhhh S%$@'s". ;)

The best book for you is going to be the one that is easiest for you to understand. Don't start with a technical manual. You'll fall asleep reading it. Try to find one with layman terms explaining the complicated stuff, like maybe one of the "dummies" series of books. Not sure if there is a "VB for Dummies" book and I'm NOT saying that you're a dummie. I'm simply saying those books are always a good place to START. They're not going to give you any detailed explanations or hard problems. After that, start using the built in HELP inside of the VB editor. Once you learn some basics, you'll be able to make inquiries using the proper search criteria (names of stuff) in the help structure. Start playing around with a small program.... say, put a bunch of numbers in several cells and several rows of one sheet, select the correct range of cells on that sheet and copy them, activate another sheet, select a starting cell somewhere in the middle and paste what you copied. Then, go back to the first sheet, select SOME of the cells you copied the first time and then clear their contents. Learning to traverse around the sheet like that, which is the same as traversing a 2D array, is at the root of everything else you'll learn.

Good luck, and be sure to let us know how you progress. If you need help, we're always here.

This discussion is closed to new replies.