Excel Скачать
презентацию
<<  Excel 2007 Шаблоны Excel  >>
Programming with Excel
Programming with Excel
Objectives
Objectives
Objectives
Objectives
Unit Introduction
Unit Introduction
Viewing VBA Code
Viewing VBA Code
Viewing VBA Code (cont
Viewing VBA Code (cont
Viewing VBA Code (cont
Viewing VBA Code (cont
Analyzing VBA Code
Analyzing VBA Code
Analyzing VBA Code (cont
Analyzing VBA Code (cont
Writing VBA Code
Writing VBA Code
Writing VBA Code (cont
Writing VBA Code (cont
Writing VBA Code (cont
Writing VBA Code (cont
Adding a Conditional Statement
Adding a Conditional Statement
Adding a Conditional Statement (cont
Adding a Conditional Statement (cont
Prompting the User for Data
Prompting the User for Data
Prompting the User for Data (cont
Prompting the User for Data (cont
Debugging a Macro
Debugging a Macro
Debugging a Macro (cont
Debugging a Macro (cont
Creating a Main Procedure
Creating a Main Procedure
Creating a Main Procedure (cont
Creating a Main Procedure (cont
Running a Main Procedure
Running a Main Procedure
Running a Main Procedure (cont
Running a Main Procedure (cont
Summary
Summary
Слайды из презентации «Microsoft Excel 2007» к уроку информатики на тему «Excel»

Автор: David Beskeen. Чтобы увеличить слайд, нажмите на его эскиз. Чтобы использовать презентацию на уроке, скачайте файл «Microsoft Excel 2007.ppt» бесплатно в zip-архиве размером 1281 КБ.

Скачать презентацию

Microsoft Excel 2007

содержание презентации «Microsoft Excel 2007.ppt»
СлайдТекст
1 Programming with Excel

Programming with Excel

Microsoft Excel 2007 - Illustrated

2 Objectives

Objectives

View VBA code Analyze VBA code Write VBA code Add a conditional statement

Microsoft Office Excel 2007 - Illustrated

2

3 Objectives

Objectives

Prompt the user for data Debug a macro Create a main procedure Run a main procedure

Microsoft Office Excel 2007 - Illustrated

3

4 Unit Introduction

Unit Introduction

Excel macros are written in a programming language called Visual Basic for Applications, or VBA Create a macro with the Excel macro recorder The recorder writes the VBA instructions for you Enter VBA instructions manually Sequence of VBA statements is called a procedure

Microsoft Office Excel 2007 - Illustrated

4

5 Viewing VBA Code

Viewing VBA Code

View existing VBA code to learn the language To view VBA code, open the Visual Basic Editor Contains a Project Explorer window, a Properties window, and a Code window VBA code appears in the Code window The first line of a procedure is called the procedure header Items displayed in blue are keywords Green notes explaining the code are called comments

Microsoft Office Excel 2007 - Illustrated

5

6 Viewing VBA Code (cont

Viewing VBA Code (cont

).

Comments

Procedure header

Keyword

Microsoft Office Excel 2007 - Illustrated

6

7 Viewing VBA Code (cont

Viewing VBA Code (cont

).

Understanding the Visual Basic Editor A module is the Visual Basic equivalent of a worksheet Store macro procedures A module is stored in a workbook, or project, along with worksheets View and edit modules in the Visual Basic Editor

Microsoft Office Excel 2007 - Illustrated

7

8 Analyzing VBA Code

Analyzing VBA Code

Analyzing VBA code Every element of Excel, including a range, is considered an object A range object represents a cell or a range of cells A property is an attribute of an object that defines one of the object’s characteristics, such as size The last line in VBA code is the procedure footer

Microsoft Office Excel 2007 - Illustrated

8

9 Analyzing VBA Code (cont

Analyzing VBA Code (cont

).

Selects range object cell A2

Applies bold formatting to range A3:F3

Sets width of columns B-F to AutoFit

Microsoft Office Excel 2007 - Illustrated

9

10 Writing VBA Code

Writing VBA Code

To write your own code, open the Visual Basic Editor and add a module to the workbook You must follow the formatting rules, or syntax, of the VBA programming language exactly A misspelled keyword of variable name will cause a procedure to fail

Microsoft Office Excel 2007 - Illustrated

10

11 Writing VBA Code (cont

Writing VBA Code (cont

).

Comments begin with apostrophes

Information between quotes will be inserted in the active cell

Microsoft Office Excel 2007 - Illustrated

11

12 Writing VBA Code (cont

Writing VBA Code (cont

).

Entering code using AutoComplete To assist you in entering the VBA code, the Editor often displays a list of words that can be used in the macro statement Typically the list appears after you press period [.]

Microsoft Office Excel 2007 - Illustrated

12

13 Adding a Conditional Statement

Adding a Conditional Statement

Sometimes you may want a procedure to take an action based on a certain condition or set of conditions One way to add this type of statement is by using an If...Then…Else statement The syntax for this statement is: If condition then statements Else [else statements]

Microsoft Office Excel 2007 - Illustrated

13

14 Adding a Conditional Statement (cont

Adding a Conditional Statement (cont

).

Elements of the If…then…Else statement appear in blue

Microsoft Office Excel 2007 - Illustrated

14

15 Prompting the User for Data

Prompting the User for Data

When automating routine tasks, sometimes you need to pause a macro for user input Use the VBA InputBox function to display a dialog box that prompts the user for information A function is a predefined procedure that returns a value

Microsoft Office Excel 2007 - Illustrated

15

16 Prompting the User for Data (cont

Prompting the User for Data (cont

).

This text will appear in a dialog box

Comment points out error in next line of the procedure

Microsoft Office Excel 2007 - Illustrated

16

17 Debugging a Macro

Debugging a Macro

When a macro procedure does not run properly, it can be due to an error, called a bug, in the code To help you find bugs in a procedure, the Visual Basic Editor steps through the procedure’s code one line at a time When you locate an error, you can debug, or correct it

Microsoft Office Excel 2007 - Illustrated

17

18 Debugging a Macro (cont

Debugging a Macro (cont

).

Indicates that the LeftFooter variable is empty

Microsoft Office Excel 2007 - Illustrated

18

19 Creating a Main Procedure

Creating a Main Procedure

Combine several macros that you routinely run together into a procedure This is a main procedure To create a main procedure, type a Call statement for each procedure you want to run

Microsoft Office Excel 2007 - Illustrated

19

20 Creating a Main Procedure (cont

Creating a Main Procedure (cont

).

MainProcedure calls each procedure in the order shown

Microsoft Office Excel 2007 - Illustrated

20

21 Running a Main Procedure

Running a Main Procedure

Running a main procedure allows you to run several macros in sequence Run a main procedure as you would any other macro

Microsoft Office Excel 2007 - Illustrated

21

22 Running a Main Procedure (cont

Running a Main Procedure (cont

).

Printing Macro Procedures

Current Module button

Current Project button

Microsoft Office Excel 2007 - Illustrated

22

23 Summary

Summary

Learn by viewing and analyzing VBA code Write VBA code using the Visual Basic Editor Use If..Then..Else statements for conditional actions Prompt user for data to automate input tasks Use the “Step Into” feature of the Visual Basic Editor to debug macros Use Main procedures to combine several macros

Microsoft Office Excel 2007 - Illustrated

23

«Microsoft Excel 2007»
http://900igr.net/prezentatsii/informatika/Microsoft-Excel-2007/Microsoft-Excel-2007.html
cсылка на страницу
Урок

Информатика

126 тем
Слайды
Презентация: Microsoft Excel 2007.ppt | Тема: Excel | Урок: Информатика | Вид: Слайды