Download presentation
Presentation is loading. Please wait.
Published byIlene Jennings Modified over 9 years ago
1
Finish Decryption 25 minutes
2
Introduction to VBA Day 4
3
Objectives: You should be able to… …open the Visual Basic Editor and understand the basic components of the editor. …implement a message box. …declare variables. …use conditional statements. …write to a text file using VBA. …understand some basic principles of programming (documentation and indentation).
4
Opening the VBA editor
5
Microsoft Visual Basic
6
Message Box MsgBox(“text” [, buttons] [, title] [helpfile, context])
7
Our first VBA program (part 1) Goal: Display a message that tells you “hello”. Sub MessageBox() MsgBox(“Hello!”) End Sub
8
Our first VBA program (part 2) Goal: –Display a message that tells you “hello”. –Title of the message box is “First Program” –The buttons are “Yes” and “No” Sub MessageBox() MsgBox(“Hello!”,vbYesNo,”First Program”) End Sub
9
Our first VBA program (part 3) Goal: –Change the message box to a yes/no question. –Add to our previous program to give a response to your answer.
10
Our first VBA program (part 4) Goal: –Modify the last program to output response to the message box to a text file.
11
Our first VBA program (part 5) Goal: –Modify the last program to output response to the message box to a text file without deleting previous content. –Also output the time and date of the response.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.