Macro Intro
Macro Intro
2010/2013
Properties window
__________________
it will show properties of the list of sheets.
According to our requirement we can change the property.
Ex: Name,standardwidth,visible etc
code window
____________
Empty space where we have to write our macro
Module code:By using this window we can work with different sheets and
workbooks.
How to get module code window
______________________________
insert->module->double click on module
class code window:in this window we can create our own classes
class contains methods,properties,events
Userform code window:In this window we will write events to work with
userforms.
How to get userform code window
______________________________
insert->userform
object browser
___________________
it will show all the list of objects available and its methods,properties and
events
Ex:?sheets(1).name
?application.Name
?sheets.Count
Types procedures
_________________
1.sub procedure
2.Function procedure
Sub Procedure:If we want to perform more than one action then we have to write code
in sub procedure
syntax:
sub macro_name()
________
___________
_________
________
end sub
Function procedure:To create our own functions we have to write code in function
procedure
syntax:
____________
______________
______________
end function
Argument:
___________
The value which we have to provide to the function as a input to get the output.
Naming Conventions(macro_name/function_name)
____________________________________________
Identifiers
__________
1.Public(by default)
2.Private
Sample macro
______________
sub test()
end sub
2007/2010/2013
or
cell reference
Comment
__________
To comment the line add single quote(') in the beginning of the line