Excel Flashcards
what is application scripting?
a way to automate lengthy manual procedures, customize and extend an application, and create a different interface.
what does it mean to record a script?
to record a manual procedure and play it back many times.
What are 4 reasons you would edit a script?
- make it more general
- eliminate unnecessary steps
- to wrap a loop around it
- to do something similar.
what do the characters ‘ and _ mean in a script?
’: comment
_: the statement continues to the next line.
what is a subroutine?
a script that does something, but doesnt return a value.
what does a function do?
returns a value
what are the data objects in excel Marcos and give 5 examples.
everything you see in a workbook; everything except the application.
1. workbook
2. worksheets
3. cells
4. charts
5. ranges
what are 3 examples properties?
colour, value and font.
what are 2 characteristics of properties?
- can be read or set in macros
- can be another object
what are 3 examples of methods?
ClearContents, Sort and Worksheet
what are 2 characteristics of methods?
- they do something to an object.
- they contain parameters
what are methods?
a type of built-in function or subroutine that does something with or to an object.
what is a member?
both a property and a method.
what is a benefit of naming ranges/cells?
by adding a blank row at the end of a named range, a macro will include any columns or rows added to the range.
what is $A$3 an example of?
an absolute reference.
when is a breakpoint used?
in debugging
what does a breakpoint do and how do you set it?
stops the macro when it gets to a specific line so you can parse the code line by line, you can set by clicking on the left margin.
Where are macros stored?
in modules
in the following script, what are the objects, methods and properties?
Application.Worksheets(“Visa”) _
.Range(“Stmt”).Font.Name = “Helvetica”
Object: Application
Methods: Worksheets(): returns a Worksheet object (goes to a worksheet), Range(): returns a Range object
Properties: Font: value is a Font object, Name: a string