3rd Grading Assignment
3rd Grading Assignment
QUIAMBAO
GRADE 9 SSP
COMPUTER PROGRAMMING
3RD GRADING ASSIGNMENT
The first method is to use the Macro Recorder. After activating the recorder,
Excel will record all the steps a user makes and save it as a “process” known as a
macro. When the user ends the recorder, this macro is saved and can be assigned to a
button that will run the exact same process again when clicked. This method is relatively
simple and requires no inherent knowledge of the VBA code. This method will work for
simple processes.
However, the downfall of this method is that it is not very customizable, and the
macro will mimic the user’s input exactly. By default, recorder macros also use absolute
referencing instead of relative referencing. IKt means that macros made in this way are
very hard to use with variables and “smart” processes.
The second and more powerful method of creating an Excel macro is to code
one using VBA.
Most of the time, the user will be working in the coding section. The file structure
section is only used for creating a new macro file. The properties section in the bottom
left will only be used for more advanced macros that use UserForms to create graphical
interfaces for the macro.
The coding section is where most, if not all, the coding happens. The user will
create, code, and save macros here. After the macro code is written and saved, it can
then be attached to certain triggers in the Excel model. The macro can be activated at
the push of a specific button on the worksheet, or when certain cells are modified, for
example. The easiest way to implement a macro is to attach it to a button.
Step 1 − First, enable 'Developer' menu in Excel 20XX. To do the same, click File →
Options.
Step 2 − Click ‘Customize the Ribbon’ tab and check 'Developer'. Click 'OK'.
Step 4 − Click the 'Visual Basic' button to open the VBA Editor.
Step 5 − Start scripting by adding a button. Click Insert → Select the button.
Step 7 − Edit the name and caption as shown in the following screenshot.
Step 8 − Now double-click the button and the sub-procedure outline will be displayed as
shown in the following screenshot.
Step 10 − Click the button to execute the sub-procedure. The output of the sub-
procedure is shown in the following screenshot. Make sure that you do have design
mode turned on. Simply click it to turn it on if it is not on.
Note − In further chapters, we will demonstrate using a simple button, as explained from
step#1 to 10. Hence , it is important to understand this chapter thoroughly.