Что такое findslide.org?

FindSlide.org - это сайт презентаций, докладов, шаблонов в формате PowerPoint.


Для правообладателей

Обратная связь

Email: Нажмите что бы посмотреть 

Яндекс.Метрика

Презентация на тему Programming with Excel

Содержание

Microsoft Office Excel 2007 - Illustrated View VBA codeAnalyze VBA codeWrite VBA codeAdd a conditional statementObjectives
Microsoft Excel 2007 - IllustratedProgramming with Excel Microsoft Office Excel 2007 - Illustrated			View VBA codeAnalyze VBA codeWrite VBA codeAdd a conditional statementObjectives Microsoft Office Excel 2007 - Illustrated			Prompt the user for dataDebug a macroCreate Microsoft Office Excel 2007 - Illustrated			Unit IntroductionExcel macros are written in a Microsoft Office Excel 2007 - Illustrated			Viewing VBA CodeView existing VBA code to Microsoft Office Excel 2007 - Illustrated			Viewing VBA Code (cont.)CommentsProcedure headerKeyword Microsoft Office Excel 2007 - Illustrated			Viewing VBA Code (cont.)Understanding the Visual Basic Microsoft Office Excel 2007 - Illustrated			Analyzing VBA CodeAnalyzing VBA codeEvery element of Microsoft Office Excel 2007 - Illustrated			Analyzing VBA Code (cont.)Selects range object cell Microsoft Office Excel 2007 - Illustrated			Writing VBA CodeTo write your own code, Microsoft Office Excel 2007 - Illustrated			Writing VBA Code (cont.)Comments begin with apostrophesInformation Microsoft Office Excel 2007 - Illustrated			Writing VBA Code (cont.)Entering code using AutoCompleteTo Microsoft Office Excel 2007 - Illustrated			Adding a Conditional StatementSometimes you may want Microsoft Office Excel 2007 - Illustrated			Adding a Conditional  Statement (cont.)Elements of Microsoft Office Excel 2007 - Illustrated			Prompting the User for DataWhen automating routine Microsoft Office Excel 2007 - Illustrated			Prompting the User for Data (cont.)This text Microsoft Office Excel 2007 - Illustrated			Debugging a MacroWhen a macro procedure does Microsoft Office Excel 2007 - Illustrated			Debugging a Macro (cont.)Indicates that the LeftFooter variable is empty Microsoft Office Excel 2007 - Illustrated			Creating a Main ProcedureCombine several macros that Microsoft Office Excel 2007 - Illustrated			Creating a Main Procedure (cont.)MainProcedure calls each Microsoft Office Excel 2007 - Illustrated			Running a Main ProcedureRunning a main procedure Microsoft Office Excel 2007 - Illustrated			Running a Main Procedure (cont.)Current ModulebuttonPrinting Macro ProceduresCurrent Projectbutton Microsoft Office Excel 2007 - Illustrated			SummaryLearn by viewing and analyzing VBA codeWrite
Слайды презентации

Слайд 2 Microsoft Office Excel 2007 - Illustrated
View VBA code
Analyze

Microsoft Office Excel 2007 - Illustrated			View VBA codeAnalyze VBA codeWrite VBA codeAdd a conditional statementObjectives

VBA code
Write VBA code
Add a conditional statement
Objectives


Слайд 3 Microsoft Office Excel 2007 - Illustrated
Prompt the user

Microsoft Office Excel 2007 - Illustrated			Prompt the user for dataDebug a

for data
Debug a macro
Create a main procedure
Run a main

procedure

Objectives


Слайд 4 Microsoft Office Excel 2007 - Illustrated
Unit Introduction
Excel macros

Microsoft Office Excel 2007 - Illustrated			Unit IntroductionExcel macros are written in

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

Слайд 5 Microsoft Office Excel 2007 - Illustrated
Viewing VBA Code
View

Microsoft Office Excel 2007 - Illustrated			Viewing VBA CodeView existing VBA code

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

Слайд 6 Microsoft Office Excel 2007 - Illustrated
Viewing VBA Code

Microsoft Office Excel 2007 - Illustrated			Viewing VBA Code (cont.)CommentsProcedure headerKeyword

(cont.)
Comments
Procedure header
Keyword


Слайд 7 Microsoft Office Excel 2007 - Illustrated
Viewing VBA Code

Microsoft Office Excel 2007 - Illustrated			Viewing VBA Code (cont.)Understanding the Visual

(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

Слайд 8 Microsoft Office Excel 2007 - Illustrated
Analyzing VBA Code
Analyzing

Microsoft Office Excel 2007 - Illustrated			Analyzing VBA CodeAnalyzing VBA codeEvery element

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

Слайд 9 Microsoft Office Excel 2007 - Illustrated
Analyzing VBA Code

Microsoft Office Excel 2007 - Illustrated			Analyzing VBA Code (cont.)Selects range object

(cont.)
Selects range object cell A2
Applies bold formatting to range

A3:F3

Sets width of columns B-F to AutoFit


Слайд 10 Microsoft Office Excel 2007 - Illustrated
Writing VBA Code
To

Microsoft Office Excel 2007 - Illustrated			Writing VBA CodeTo write your own

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

Слайд 11 Microsoft Office Excel 2007 - Illustrated
Writing VBA Code

Microsoft Office Excel 2007 - Illustrated			Writing VBA Code (cont.)Comments begin with

(cont.)
Comments begin with apostrophes
Information between quotes will be inserted

in the active cell

Слайд 12 Microsoft Office Excel 2007 - Illustrated
Writing VBA Code

Microsoft Office Excel 2007 - Illustrated			Writing VBA Code (cont.)Entering code using

(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 [.]

Слайд 13 Microsoft Office Excel 2007 - Illustrated
Adding a Conditional

Microsoft Office Excel 2007 - Illustrated			Adding a Conditional StatementSometimes you may

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]

Слайд 14 Microsoft Office Excel 2007 - Illustrated
Adding a Conditional

Microsoft Office Excel 2007 - Illustrated			Adding a Conditional Statement (cont.)Elements of

Statement (cont.)
Elements of the If…then…Else statement appear in blue


Слайд 15 Microsoft Office Excel 2007 - Illustrated
Prompting the User

Microsoft Office Excel 2007 - Illustrated			Prompting the User for DataWhen automating

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

Слайд 16 Microsoft Office Excel 2007 - Illustrated
Prompting the User

Microsoft Office Excel 2007 - Illustrated			Prompting the User for Data (cont.)This

for Data (cont.)
This text will appear in a dialog

box

Comment points out error in next line of the procedure


Слайд 17 Microsoft Office Excel 2007 - Illustrated
Debugging a Macro
When

Microsoft Office Excel 2007 - Illustrated			Debugging a MacroWhen a macro procedure

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

Слайд 18 Microsoft Office Excel 2007 - Illustrated
Debugging a Macro

Microsoft Office Excel 2007 - Illustrated			Debugging a Macro (cont.)Indicates that the LeftFooter variable is empty

(cont.)
Indicates that the LeftFooter variable is empty


Слайд 19 Microsoft Office Excel 2007 - Illustrated
Creating a Main

Microsoft Office Excel 2007 - Illustrated			Creating a Main ProcedureCombine several macros

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

Слайд 20 Microsoft Office Excel 2007 - Illustrated
Creating a Main

Microsoft Office Excel 2007 - Illustrated			Creating a Main Procedure (cont.)MainProcedure calls

Procedure (cont.)
MainProcedure calls each procedure in the order shown


Слайд 21 Microsoft Office Excel 2007 - Illustrated
Running a Main

Microsoft Office Excel 2007 - Illustrated			Running a Main ProcedureRunning 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

Слайд 22 Microsoft Office Excel 2007 - Illustrated
Running a Main

Microsoft Office Excel 2007 - Illustrated			Running a Main Procedure (cont.)Current ModulebuttonPrinting Macro ProceduresCurrent Projectbutton

Procedure (cont.)
Current
Module
button
Printing Macro Procedures
Current Project
button


  • Имя файла: programming-with-excel.pptx
  • Количество просмотров: 143
  • Количество скачиваний: 0