1 / 12
文档名称:

A.Primer.On.Macro.Programming.With.Visual.BASIC.for.Applications-Excel.pdf

格式:pdf   页数:12
下载后只包含 1 个 PDF 格式的文档,没有任何的图纸或源代码,查看文件列表

如果您已付费下载过本站文档,您可以点这里二次下载

A.Primer.On.Macro.Programming.With.Visual.BASIC.for.Applications-Excel.pdf

上传人:bolee65 2014/1/9 文件大小:0 KB

下载得到文件列表

A.Primer.On.Macro.Programming.With.Visual.BASIC.for.Applications-Excel.pdf

文档介绍

文档介绍:A PRIMER ON
MACRO PROGRAMMING WITH
Visual BASIC for Applications/Excel



by

Steven C. Chapra
Room 223 (Telephone: 617 727 3654)
e-mail: ******@
Civil and Environmental Engineering Department
Tufts University
Medford, MA

October 14, 1999

BIBLIOGRAPHY

• Walkenbach, John, Microsoft Excel 2000 Power Programming With Vba, IDG Books, Foster
City, CA, 1999, ISBN: 0-7645-3263-4, $ + shipping ().

• Walkenbach, John, Excel 2000 for Windows for Dummies : Quick Reference (--For Dummies),
IDG Books, Foster City, CA, 1999, ISBN: 0-7645-0447-9, $ + shipping
().

Tufts 1 VBA Primer
The Basics of Programming in Visual BASIC

Computer programming is not difficult. It really amounts to

• Learning several general concepts
• Being careful, organised and logical
• Practice

In this primer, we will outline the general concepts using the Visual puter
language.

There are only 8 fundamental concepts puter programming to
solve numerical problems confronted by engineers. These are

1. The “idea” of a program
2. Constants, variables, assignment and types
3. Mathematics
4. Decisions
5. Loops
6. Arrays
7. Macros, functions and subroutines
8. Input/output

The following sections provide some detail on each of these concepts.

1. THE “IDEA” OF A PROGRAM

A program is a set of instructions to tell puter to do something. The simplest
type is a sequence of instructions that puter implements one after another in a
mindless fashion. These instructions are sometimes called statements. For example, in
Visual BASIC

Sub Adder()
a = 10
b = 33
c = a + b
Msgbox c
End Sub

Although some of the words might seems alien, it’s not too difficult to see that the
computer will add two numbers together and then display the answer. In this case,
because we’re using Excel, we employ a “message box” to display the answer on the
spreadsheet.