Académique Documents
Professionnel Documents
Culture Documents
Sub Macroname()
Commands
End Sub
Coding Procedure:
Object.property/Method
Byte=200
X as byte
X=200
Dim X as Byte
X=200
Ways of declaration
Dim x as byte
Dim y as byte
Dim x as byte, y as string
Dim x , y as byte
Dim x , y
Loops: Repeatition/Iteration
1.For Next Loop: It can used when we are aware of how
many times to run the Loop.
2.Do Loop:It can used when we are not aware of how
many times to run the Loop
1.Do While:Runs the loop if condition given is true
2.Do until:Runs the Loop if condition given is False
3.For each Next Loop:it can be used only when group of
objects are available
For Next Loop Syntax:
Forward Loop:
For Variable=Minval to Maxval step +
Commands
Next Variable
Reverse Loop:
For Variable=Maxval to Minval step –
Commands
Next Variable
2. IF Condition then
Result
Else
Result
End if
3. Nested IF:
IF Condition then
Result
Elseif condtion then
Result
Else
Result
End if
Case Stmt:
And--to or—“,”
Select Case Value
Case1
Result
Case2
Result
Case else
Result
End select
2.Do Loop:It can used when we are not aware of how
many times to run the Loop
1.Do While:Runs the loop if condition given is true
2.Do until:Runs the Loop if condition given is False
Do While Condtion(T)
Commands
Loop
Do Until Condition(F)
Commands
Loop
3.For each Next Loop:it can be used only when group of
objects are available
For each Variable in Group of objects
Commands
Next variable
VBA/Worksheetfunctions:
VBA Functions All Platform whr VBA Supported
Worksheetfunction Can be used only on spreadsheet