"Excel VBA Help"

 


Play Friv Now - Play Friv Games
Our Info Pages:-
The Code Cage - Microsoft Office help

Notices

» Sponsored Links
Sponsored Links
juhlamekkoja - juhlamekkoja

Contact Us to Advertise here!

» Tutorial Library

VBA Starters:


Courtesy of Craig Hatmaker

Intro to VBA


Why VBA?


VBA allows us to:
· Automate repetitive tasks – Ex. Creating daily charts
· Enforce standards on tasks – Ex. Making sure journal entries balance before posting
· Simplify complex tasks – Ex. Creating user defined functions to replace long, convoluted formulas
· Perform tasks that would be otherwise impossible – Ex. Posting data to external databases

What is VBA?

VBA stands for Visual Basic for Applications. VBA is known as the “Macro” language for Microsoft’s (and others’)

Office applications (aka “Host Applications”). Even though VBA is found in many different applications (Excel, Outlook, Access, Word, Visio, and others), the things that make up this computer language such as Functions,
Variable Types, Operators, and Branching and Looping are the same in all of them:

Functions
Just like Excel, VBA has a rich functions library. Some are exclusive to VBA. Many are

similar to Excel. For example, Excel’s Absolute Value function is ABS(). So is VBA’s.
Variable Types
Variables are like Excel’s cells – they hold values that can be read or changed. Unlike
Excel’s cells, variables must be of certain types that determine what the variable can
hold. Two common variable types are:

Integer Holds small whole numbers for use in math operations
String Holds anything you can type but won’t use in math operations.

Operators
Just like Excel, VBA has a rich set of operators such as:
Comparison Operators
=, >, <
Arithmetic Operators
+, -, *, /

Branching and Looping
This differentiates Excel from a procedural language like VBA. Branching and looping
are why VBA is a strong complement to Excel. The procedural elements of VBA are:
If/Then/Else Statements
Used to conditionally run specific sections of VBA code
Select Case statements Similar to If/Then/Else, Select Case statements run specific sections of VBA code based on an a single expression that can have multiple values.

1 Wiki on VBA:

http://en.wikipedia.org/wiki/Visual_Basic_for_Applications
2 Wiki on Macro:

http://en.wikipedia.org/wiki/Macro
3 MSDN on VBA’s functions:

http://msdn.microsoft.com/en-us/library/gg278941.aspx
4 Wiki on Procedural Programming:

http://en.wikipedia.org/wiki/Procedural_programming_languages

For Each, For Next Loops Used for repeating sections of VBA code a set number of times
Do, Do While, Do Until, Loops Used for conditionally repeating sections of VBA code

As you can see, VBA is similar is some respects to Excel, so leaning VBA isn’t that difficult for Excel’s users. And once you’ve leaned VBA, you can use it to add automation to many different applications without having to learn different languages.


Questions asked on Excel VBA by our members




.....Read More (entire tutorial!)
» Recent Threads
Title, Username, & Date Forum
Match Multiple Value & Update the Amount
babulipanda
10th September 2014 20:24
Microsoft Excel Forum
How do I reduce the spacing between lines on a...
Spacing between lines in Word labels
30th July 2009 15:54
Microsoft Word Forum
export data from book1.xls to a different workbook
Brando Hanjin
3rd September 2014 17:09
Microsoft Excel Forum
Copy Data & Color from one worksheet to...
RedBaron
17th September 2014 06:22
Microsoft Excel Forum
Help Understanding and debugging Code
bdouglas1011
15th September 2014 18:59
Microsoft Excel Forum
Compare two sentences and highlight in different...
vlnmca
15th September 2014 17:48
Microsoft Excel Forum
Compare two sentences and highlight in different...
vlnmca
15th September 2014 16:35
Microsoft Excel Forum
count duplicates
Brando Hanjin
5th September 2014 23:55
Microsoft Excel Forum
Importing a .txt to vba and get some datas to use...
Woshin
5th September 2014 15:38
Microsoft Excel Forum
Analyse South African ID number
Hennie Neuhoff
9th September 2014 04:32
Microsoft Excel Forum
expot data from outlook to existing workbook
Brando Hanjin
5th September 2014 22:46
Microsoft Excel Forum
Lots of multiple conditions in VBA
LisaGreen
4th September 2014 15:21
Microsoft Excel Forum
Plot coordinates
john55
29th August 2014 10:26
Microsoft Excel Forum
using conditonal formating based on cell value,...
Brando Hanjin
3rd September 2014 23:23
Microsoft Excel Forum
» News
Embed values in a UserForm
Aug 27, 2014 - 12:28 AM - by Leith Ross
A new entry has been added to Code Cage Downloads, category Excel VBA

Description: Now you can permanently save and restore UserForm control values in the UserForm itself with two easy to use macros. Please, see the workbook for more... [Read More]
Powered by vBadvanced CMPS v3.1.0
The Code Cage Affilliates



http://www.thecodecage.com/forumz tested by McAfee Security http://www.thecodecage.com/forumz tested by McAfee Security

All times are GMT +1. The time now is 02:45.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Template-Modifications by TMS
No part of this board, functionality or creatives may be copied or reproduced either in part or full without the express permission of The Code Cage Team.
Copyright ©2008 - , Simon lloyd.
We are not associated with nor employed by Microsoft in any way, we simply provide resources!
All MS office icons are registered trademarks of the application they represent and are used with permission from Microsoft
UA-8135493-1