|
211- Why use macros?
While there are a number of features and tools that
can be used to optimize and speed up workflow,
there are still series of tasks and commands that many users will find very
repetitive and time consuming. However, it is possible to create a custom macro
that will execute such a sequence of commands on your behalf with just one
click of a button. In the steps below, we’ll show how easy it is to construct a
standard macro in Excel.
Step
1: Make sure the Developer tab is
shown on the Excel ribbon. If it is not, you can add it by clicking on the
Office button and then selecting Excel Options.
In the Excel Options window, select Popular from the list of categories in the left hand panel.
Put a check in the box next to Show Developer tab in the Ribbon.
Click the OK button to return to
Excel. The Developer tab will now be present on the ribbon.
212- Creating a macro
Record a macro:
When you record a macro, all steps that are needed to
complete the actions that you want to record are recorded by the macro
recorder.
1.
On the Developer tab, in the Code group,
click Record Macro.
2.
In the Macro name box, enter a name for the
macro.
The first character of the macro name must be a
letter. Following characters can be letters, numbers, or underscore characters.
Spaces are not allowed in a macro name; an underscore character works well as a
word separator. If you use a macro name that is also a cell reference, you may
get an error message that the macro name is not valid.
3.
To assign a CTRL combination shortcut key to run the macro, in the Shortcut key box, type any lowercase letter
or uppercase letter that you want to use.
4.
The shortcut key will override any equivalent default
Excel shortcut key while the workbook that contains the macro is open. For a
list of CTRL combination shortcut keys that are already assigned in Excel.
5.
In the Store macro in list, select the workbook
in which you want to store the macro.
6.
To include a description of the macro, in the Description box, type the text that you want.
7.
Click OK to start recording.
8.
Perform the actions that you want to record.
9.
On the Developer tab, in the Code group,
click Stop Recording.
10.
You can also click Stop Recording, on the left side of the status bar.
213- Macro security
Change macro
security settings:
You can change macro security settings in the Trust
Center, unless a system administrator in your organization has changed the
default settings to prevent you from changing the settings.
1)
On the Developer tab, in the Code group,
click Macro Security.
2)
In the Macro Settings category, under Macro Settings,
click the option that you want.
3)
You can also access the Trust Center in the Excel
Options dialog box. Click the Microsoft Office Button
Macro security
settings and their effects:
The following list summarizes the various macro
security settings.
Back To Top Back To Excel Index Page (Open Exercise file)
|