Register now or log in to join your professional community.
Using macro and vba
first of all try to record a macro using the record button, how?( Press the record button then type a word in some cell, change the back color of another cell , save the file.... etc then press the stop button)
now you have your first macro.....
press ( ctrl + F11) to see the code....
it is very simple code you change it using the language ( Visual basic)
the main topics in VBA are ( msgbox, Inputbox, variables, If , For)
Thank you for the insight, this might help to start programming in ms applications.
This article demonstrates how you can create a Microsoft Excel VBA macro programmatically from Microsoft Visual Basic, call it, and associate it with a toolbar button.
In Excel (2010) you kan find under 'Developer' the Visual Basic toolbar button.
For simple tasks a VBA program (macro) can be created just by recording, but a "professional" program requires quite some research and editing. Important is to decide beforehand on certain points:
- User interaction (buttons, entry fields etc.)
- The data (input, handling process, output)
- Required parameters (fixed, flexible, or perhaps depending on the analyzed data)
If you have decided on the above, then the data handling can be structured. Are there some processes that can be put in sub-routines, or are there repetetive processes (iteration from1 to n)?
Error handling and some data validation techniques are as well very important. The fastest way to have errors being multiplied all trough your business is by using VBA scripting... :-)
The last bit is the output. Are you printing, mailing, or saving output on file, (to have it checked before printing), or perhaps creating files to export to other applications?
If you have done all above, you can start pressing the Visual Basic toolbar button.
The rest you can find in a VBA book, on-line tutorials and the VBA help texts.
I hope this helps.....