Visual Basic From Excel or Word
Visual Basic From Excel or Word
End Sub
Click on the taskbar Run\Run. The program runs and you get
UserForm1 with the textbox and command button.
(c) Click the command button: the program executes and displays in
the textbox the expected
Output is 1 2 3 4 5 6 7 8 9 10
(d) click the x on the top right corner of UserForm1 to stop the
program.
Part B running the Make Values program.
1. Double click on the CommandButton1 to bring up the code window.
Delete the program we have just written in, but leave the braces
there. Paste in, or type in, the program Make Values from the
Crypto Drop Box.
2. On the Task Bar click View\Project Explorer and in the box that
appears click on UserForm1 to get our form back.
3. On the Task Bar click on View\Properties to get a small box called
Properties_TextBox1. In this box
- click MultiLine and choose true
- click Font and a small button will appear on the font line.
Click this button to get a dialogue box, in which choose Courier New
and size 10.
4. Now click Run\Run to run the program and click CommandButton1.
5. The program will create indices for each of the three words
STUBTOES, FOURDOOR and DUOAORBB. Then from the perm 5089721463 the
values of the three words will be calculated. Finally the program
displays all this data as follows:
word(0) = STUBTOES
word(1) = FOURDOOR
word(2) = DUOAORBB
derived alpha=STUBOEFRDA
index(0)=
index(1)=
index(2)=
0 1 2 3 1 4 5 0
6 4 2 7 8 4 4 7
8 2 4 9 4 7 3 3
if perm =
5 0 8 9 7 2 1 4 6 3
value(0) =
value(1) =
value(2) =
50890725
17846774
68737499
the labour out of pencil and paper work, and leave you to solve with
your own initiative rather than the computers muscle. photon is an
arch-exponent of this art.
Help is available from the Visual Basic Editor taskbar, from the MS
Visual Basic web site and from numerous manuals.