visual basic programming using excel
DESCRIPTION
Visual Basic Programming Using Excel. September 12, 2006. What Programming Will Do. Make a good engineer better Make a bad engineer worse by magnifying his/her ineptitude. Common Lies of Programmers. The program ran fine yesterday and I did not change a thing but now it will not work. - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Visual Basic Programming Using Excel](https://reader034.vdocument.in/reader034/viewer/2022050707/5681588d550346895dc5ecc1/html5/thumbnails/1.jpg)
Visual Basic Programming Using Excel
September 12, 2006
![Page 2: Visual Basic Programming Using Excel](https://reader034.vdocument.in/reader034/viewer/2022050707/5681588d550346895dc5ecc1/html5/thumbnails/2.jpg)
What Programming Will Do
• Make a good engineer better
• Make a bad engineer worse by magnifying his/her ineptitude
![Page 3: Visual Basic Programming Using Excel](https://reader034.vdocument.in/reader034/viewer/2022050707/5681588d550346895dc5ecc1/html5/thumbnails/3.jpg)
Common Lies of Programmers
• The program ran fine yesterday and I did not change a thing but now it will not work.
• I used the same program as was given in class, but it does not want to work for me.
• I looked through all of the code 10 times and I am sure that there are no mistakes. Why won’t it run?
![Page 4: Visual Basic Programming Using Excel](https://reader034.vdocument.in/reader034/viewer/2022050707/5681588d550346895dc5ecc1/html5/thumbnails/4.jpg)
Why in the World Would You Need to be able to Program?
2
1
N
i
y i
![Page 5: Visual Basic Programming Using Excel](https://reader034.vdocument.in/reader034/viewer/2022050707/5681588d550346895dc5ecc1/html5/thumbnails/5.jpg)
![Page 6: Visual Basic Programming Using Excel](https://reader034.vdocument.in/reader034/viewer/2022050707/5681588d550346895dc5ecc1/html5/thumbnails/6.jpg)
![Page 7: Visual Basic Programming Using Excel](https://reader034.vdocument.in/reader034/viewer/2022050707/5681588d550346895dc5ecc1/html5/thumbnails/7.jpg)
![Page 8: Visual Basic Programming Using Excel](https://reader034.vdocument.in/reader034/viewer/2022050707/5681588d550346895dc5ecc1/html5/thumbnails/8.jpg)
![Page 9: Visual Basic Programming Using Excel](https://reader034.vdocument.in/reader034/viewer/2022050707/5681588d550346895dc5ecc1/html5/thumbnails/9.jpg)
![Page 10: Visual Basic Programming Using Excel](https://reader034.vdocument.in/reader034/viewer/2022050707/5681588d550346895dc5ecc1/html5/thumbnails/10.jpg)
![Page 11: Visual Basic Programming Using Excel](https://reader034.vdocument.in/reader034/viewer/2022050707/5681588d550346895dc5ecc1/html5/thumbnails/11.jpg)
![Page 12: Visual Basic Programming Using Excel](https://reader034.vdocument.in/reader034/viewer/2022050707/5681588d550346895dc5ecc1/html5/thumbnails/12.jpg)
![Page 13: Visual Basic Programming Using Excel](https://reader034.vdocument.in/reader034/viewer/2022050707/5681588d550346895dc5ecc1/html5/thumbnails/13.jpg)
50 202
1 1k i
y k i
y = 0For k = 1 To 50 Step 1 y1 = 0 For i = 1 To 20 Step 1 y1 = y1 + k + i^2 Next i y = y + y1Next k
![Page 14: Visual Basic Programming Using Excel](https://reader034.vdocument.in/reader034/viewer/2022050707/5681588d550346895dc5ecc1/html5/thumbnails/14.jpg)
Intrinsic Functions in Visual Basic
Absolute Value of x Abs(x)
Arctangent of x Atn(x)
Cosine of x Cos(x)
ex Exp(x)
Natural Log of x Log(x)
Random Number Generator, 0 – 1 Rnd()
Sign of x Sgn(x)
Sine of x Sin(x)
Square Root of x Sqr(x)
Tangent of x Tan(x)
![Page 15: Visual Basic Programming Using Excel](https://reader034.vdocument.in/reader034/viewer/2022050707/5681588d550346895dc5ecc1/html5/thumbnails/15.jpg)
![Page 16: Visual Basic Programming Using Excel](https://reader034.vdocument.in/reader034/viewer/2022050707/5681588d550346895dc5ecc1/html5/thumbnails/16.jpg)
Open up Excel and write a function subroutine which calculates the area of a circle given its diameter.
Before writing the program, listen to the instructor about macro security.
![Page 17: Visual Basic Programming Using Excel](https://reader034.vdocument.in/reader034/viewer/2022050707/5681588d550346895dc5ecc1/html5/thumbnails/17.jpg)
![Page 18: Visual Basic Programming Using Excel](https://reader034.vdocument.in/reader034/viewer/2022050707/5681588d550346895dc5ecc1/html5/thumbnails/18.jpg)
![Page 19: Visual Basic Programming Using Excel](https://reader034.vdocument.in/reader034/viewer/2022050707/5681588d550346895dc5ecc1/html5/thumbnails/19.jpg)
![Page 20: Visual Basic Programming Using Excel](https://reader034.vdocument.in/reader034/viewer/2022050707/5681588d550346895dc5ecc1/html5/thumbnails/20.jpg)
Fully Developed Flow of a Quasi-Incompressible Fluid
x
y
W
H
![Page 21: Visual Basic Programming Using Excel](https://reader034.vdocument.in/reader034/viewer/2022050707/5681588d550346895dc5ecc1/html5/thumbnails/21.jpg)
u u P
x y L
u = 0 at walls
Governing Equations
![Page 22: Visual Basic Programming Using Excel](https://reader034.vdocument.in/reader034/viewer/2022050707/5681588d550346895dc5ecc1/html5/thumbnails/22.jpg)
1
2 2
2
sinh sinh( , ) 1
sinh
2 2, 1 1 , sin ,
nn nn
nn n n
n
n n n
y H yau x y
H
n W n x Pa
W W n W W L
Analytical Solution #1
![Page 23: Visual Basic Programming Using Excel](https://reader034.vdocument.in/reader034/viewer/2022050707/5681588d550346895dc5ecc1/html5/thumbnails/23.jpg)
Intrinsic Functions in Visual Basic
Absolute Value of x Abs(x)
Arctangent of x Atn(x)
Cosine of x Cos(x)
ex Exp(x)
Natural Log of x Log(x)
Random Number Generator, 0 – 1 Rnd()
Sign of x Sgn(x)
Sine of x Sin(x)
Square Root of x Sqr(x)
Tangent of x Tan(x)
![Page 24: Visual Basic Programming Using Excel](https://reader034.vdocument.in/reader034/viewer/2022050707/5681588d550346895dc5ecc1/html5/thumbnails/24.jpg)
![Page 25: Visual Basic Programming Using Excel](https://reader034.vdocument.in/reader034/viewer/2022050707/5681588d550346895dc5ecc1/html5/thumbnails/25.jpg)
Analytical Solution #2
1 1
2 2
2
,
2 21 1 , , sin
n mm n
n m m n
m
m m m
a bu x y
H m m yb
H m H H H
![Page 26: Visual Basic Programming Using Excel](https://reader034.vdocument.in/reader034/viewer/2022050707/5681588d550346895dc5ecc1/html5/thumbnails/26.jpg)