Start networking and exchanging professional insights

Register now or log in to join your professional community.

Follow

How can we create a professional visual basic for application (vba) program in ms excel?

user-image
Question added by Jeffrey Villostas , Application Support Staff @ Riyadh Metro Project , SAUDI ARABIAN BECHTEL COMPANY
Date Posted: 2013/09/02
Mutassem Watfa
by Mutassem Watfa , Finance Manager , Talas Group

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)

 

 

Jeffrey Villostas
by Jeffrey Villostas , Application Support Staff @ Riyadh Metro Project , SAUDI ARABIAN BECHTEL COMPANY

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.

Deleted user
by Deleted user

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.....

More Questions Like This