Intro to Excel - Session 7.31 Tutorial 7 - Session 7.3 Developing an Excel Application.

16
Intro to Excel - Session 7.3 1 Tutorial 7 - Session 7.3 Developing an Excel Application

Transcript of Intro to Excel - Session 7.31 Tutorial 7 - Session 7.3 Developing an Excel Application.

Page 1: Intro to Excel - Session 7.31 Tutorial 7 - Session 7.3 Developing an Excel Application.

Intro to Excel - Session 7.3 1

Tutorial 7 - Session 7.3

Developing an Excel Application

Page 2: Intro to Excel - Session 7.31 Tutorial 7 - Session 7.3 Developing an Excel Application.

Intro to Excel - Session 7.3 2

Session 7.3 Objectives

• Discuss what macros are• Learn how macros can be use to automate

tasks• Plan and create a macros

Page 3: Intro to Excel - Session 7.31 Tutorial 7 - Session 7.3 Developing an Excel Application.

Intro to Excel - Session 7.3 3

What is a Macro?

• A series of commands and functions that perform a particular task

• They carry out repetitive tasks quickly and accurately

Page 4: Intro to Excel - Session 7.31 Tutorial 7 - Session 7.3 Developing an Excel Application.

Intro to Excel - Session 7.3 4

Creating Macros

• Use the macro recorder to record keystrokes and mouse actions as they are performed

OR

• Write the macro using Visual Basic for

Applications (VBA)

Page 5: Intro to Excel - Session 7.31 Tutorial 7 - Session 7.3 Developing an Excel Application.

Intro to Excel - Session 7.3 5

Planning a Macros

• Decide what you want to accomplish

• Determine the “best” way to do it

• Practice the keystrokes and mouse actions

• Select an appropriate name

• Decide where to store the macro

• Ensure the worksheet is set up exactly as it will be at playback time

Page 6: Intro to Excel - Session 7.31 Tutorial 7 - Session 7.3 Developing an Excel Application.

Intro to Excel - Session 7.3 6

Where to Store the Macro?

• As part of the current workbook (default)• A special workbook name “Personal Macro”• A new workbook file

Page 7: Intro to Excel - Session 7.31 Tutorial 7 - Session 7.3 Developing an Excel Application.

Intro to Excel - Session 7.3 7

Recording a Macro

• Select Tools Macro Record New Macro...

(continued)

Page 8: Intro to Excel - Session 7.31 Tutorial 7 - Session 7.3 Developing an Excel Application.

Intro to Excel - Session 7.3 8

Recording a Macro (continued)

• Push the OK button to start recording

• Perform the task

• Push the Stop Recording button on the Stop Recording toolbar

Page 9: Intro to Excel - Session 7.31 Tutorial 7 - Session 7.3 Developing an Excel Application.

Intro to Excel - Session 7.3 9

Running a Macro

• Select Tools Macro Macros…

• Select the macroyou want to run

• Push the Run button

Page 10: Intro to Excel - Session 7.31 Tutorial 7 - Session 7.3 Developing an Excel Application.

Intro to Excel - Session 7.3 10

Running a Macro Quickly

• Assign the macro to a shortcut key

• Assign the macro to a command that appears on a menu

• Assign the macro to a button on a toolbar

• Assign the macro to a drawing object

Page 11: Intro to Excel - Session 7.31 Tutorial 7 - Session 7.3 Developing an Excel Application.

Intro to Excel - Session 7.3 11

Assigning a Shortcut Key

• Select Tools Macro Macros…

• Select the macro

• Push the Options...button

(continued)

Page 12: Intro to Excel - Session 7.31 Tutorial 7 - Session 7.3 Developing an Excel Application.

Intro to Excel - Session 7.3 12

Assigning a Shortcut Key (continued)

• Click in the Shortcut key text box

• Enter a character

• Push the OK button

Page 13: Intro to Excel - Session 7.31 Tutorial 7 - Session 7.3 Developing an Excel Application.

Intro to Excel - Session 7.3 13

Viewing the Macro Code

• Select Tools Macro Macros…

• Select the macro

• Push the Editbutton

(continued)

Page 14: Intro to Excel - Session 7.31 Tutorial 7 - Session 7.3 Developing an Excel Application.

Intro to Excel - Session 7.3 14

Viewing Macro Code (continued)

Page 15: Intro to Excel - Session 7.31 Tutorial 7 - Session 7.3 Developing an Excel Application.

Intro to Excel - Session 7.3 15

Assigning a Macro to a Button

• Push the button button on theForms toolbar

• Place and size the button onthe worksheet

(continued)

Page 16: Intro to Excel - Session 7.31 Tutorial 7 - Session 7.3 Developing an Excel Application.

Intro to Excel - Session 7.3 16

Assigning a Macro to a Button (continued)

• Select the name of macro you want toassign to the button

• Push the OK button