Word Document Properties


Part I: An Overview of VBA



Download 8,82 Mb.
Pdf ko'rish
bet42/207
Sana16.03.2022
Hajmi8,82 Mb.
#496217
1   ...   38   39   40   41   42   43   44   45   ...   207
Bog'liq
VBA For Dummies 5th Ed.pdf ( PDFDrive )

Part I: An Overview of VBA 
06_046500 ch02.qxp 12/5/06 5:33 PM Page 34


Steps to Create a VBA Program
Writing a program usually involves four steps. In this section, I tell you about
the four steps while you create your first permanent program — one that you
can run as often as you like. The permanent program displays a dialog box,
just like the example in Chapter 1.
Step 1: Design the program
In the “Deciding What to Do” section, earlier in this chapter, I tell you how to
plan your program. I also tell you what questions you should ask in prepara-
tion for writing the program. This step is actually part of the design phase,
but most developers make it a separate step. Thinking through your applica-
tion before you commit something to paper is important.
After you plan your application, you can use any of a number of techniques to
design the program. Some people use the 
flowcharting
technique, which uses
special symbols to replace programming elements. Other people use special-
ized engineering software to do the job. You might read about these methods
when you get more involved with VBA. However, the best way to design most
simple applications is to use 
pseudo-coding,
a method in which you write
down a list of steps in your own words that say what you want VBA to do.
Using pseudo-code is a good way to think about how you want to write the
code without getting too concerned about coding issues. This example dis-
plays a dialog box. The pseudo-code can be as easy as
Display the message box.
See which button the user clicked.
End the program.
Don’t worry about being precise about the pseudo-code. The idea is to write
a list of steps that you can understand before you begin writing code. If you
don’t understand what you want to do, it’s unlikely that you can tell VBA how
to do it. Pseudo-code is a method for putting your words into a form that you
can convert to code later.
You can also add pseudo-code as comments to the VBA code that you write.
In Chapter 3, I show you how to use comments in your code. Using your pseudo-
code as a basis for comments that appear in your code helps you tell others
about the thought process used to design the program. Never write a program
that is devoid of comments because you might need to make changes later.
35

Download 8,82 Mb.

Do'stlaringiz bilan baham:
1   ...   38   39   40   41   42   43   44   45   ...   207




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©hozir.org 2024
ma'muriyatiga murojaat qiling

kiriting | ro'yxatdan o'tish
    Bosh sahifa
юртда тантана
Боғда битган
Бугун юртда
Эшитганлар жилманглар
Эшитмадим деманглар
битган бодомлар
Yangiariq tumani
qitish marakazi
Raqamli texnologiyalar
ilishida muhokamadan
tasdiqqa tavsiya
tavsiya etilgan
iqtisodiyot kafedrasi
steiermarkischen landesregierung
asarlaringizni yuboring
o'zingizning asarlaringizni
Iltimos faqat
faqat o'zingizning
steierm rkischen
landesregierung fachabteilung
rkischen landesregierung
hamshira loyihasi
loyihasi mavsum
faolyatining oqibatlari
asosiy adabiyotlar
fakulteti ahborot
ahborot havfsizligi
havfsizligi kafedrasi
fanidan bo’yicha
fakulteti iqtisodiyot
boshqaruv fakulteti
chiqarishda boshqaruv
ishlab chiqarishda
iqtisodiyot fakultet
multiservis tarmoqlari
fanidan asosiy
Uzbek fanidan
mavzulari potok
asosidagi multiservis
'aliyyil a'ziym
billahil 'aliyyil
illaa billahil
quvvata illaa
falah' deganida
Kompyuter savodxonligi
bo’yicha mustaqil
'alal falah'
Hayya 'alal
'alas soloh
Hayya 'alas
mavsum boyicha


yuklab olish