variables programming statements
|
|
- Eustacia Warren
- 5 years ago
- Views:
Transcription
1 1 VB PROGRAMMERS GUIDE LESSON 1 File: VbGuideL1.doc Date Started: May 24, 2002 Last Update: Dec 27, 2002 ISBN: Version: 0.0 INTRODUCTION TO VB PROGRAMMING VB stands for Visual Basic. Visual Basic is a programming language that lets you program window GUI programs very fast. GUI stands for Graphic User Interface. All windows programs are GUI's. These guides will teach you VB programming with step by step instructions. If you do all the exercises in these lessons you will become a very good VB programmer. In each lesson we use bold to introduce new programming concepts, underline for important programming concepts, violet for program definitions and blue for programming code examples. VB Data Types and Variables A program lists instructions as words to instruct a computer to do something. The words form a programming statement, just like we use words in a sentence. Which words are used defines the programming language. Each programming language as their own set of words. The words chosen for Visual Basic make it easy for some one to learn programming. All programs need data to represent values. Programming languages use numeric data like 10.5 or string data like "hello". These different types of data are known as data types. Here is a chart of all data types used in Visual Basic. Data Type Sample value Range of values String "hello there" Alphanumeric characters, digits and other characters Integer -5 Whole numbers ranging from -32,768 to 32,767 Long Large whole numbers having range: to Boolean True True or False Byte 10 small numbers range 0 to 255 Single Single-precision floating point numbers with six digits of accuracy. Double E30 Double-precision floating point numbers with 14 digits of accuracy Currency Decimal fractions, such as dollars and cents. Date #5/23/2002# month, day, year, various date formats available Object frm as Form Objects represent a group of many values Variant v as variant A variant can represent any data type. The variable's data type will depend on the value that was last assigned to it. Decimal Double-precision floating point number with 14 digits of accuracy. Data is stored in computer memory. The location and value where the data is stored is represented by a variable. A variable gets an identification name like: x. The identification name must start with a letter. Additional letters or digits may follow the first Letter, like: x1. VB Program variables programming statements
2 2 Declaring Variables Before you can use a variable it has to be declared. To declare a variable you use the Dim keyword and specify the data type. Dim x as Integer Code (blue) Dim identifier As datatype Definition (violet) In the above example x is declared as a variable of Integer data type. Keywords are used in programming languages as commands. Dim means declare variable, as means specify data type. Using Variables Think of a variable as a box that holds a value represented by an identifier. If you know the name of the identifier then you can get its value. The value is stored in computer memory represented by the variable. x 5 After you declare a variable, you can give it a value. When you give a value to a variable it is known as assigning or initializing. Here is an example declaring an Integer variable x and initializing to an integer value. Dim x As Integer x = 5 x 5 Here is an example of declaring a string variable and initializing it with a string value: Dim name As String name = "Ed" name "Ed" Later in your program you can assign different values to your variables: name = "Tom" name "Tom" In this situation the old value is replaced with the new value. The old value disappears, gone forever You can even assign a variable to another variable: Dim x As Integer Dim y As Integer x = 10 x 10 y = x y 10 In this situation the value of variable x is assigned to variable y. Remember, it is the value represented by the variable that is assigned not the name of the variable. The value is obtained from the name. As you use your variables the values will be always changing.
3 3 VB Sample Program We are now ready to write our first VB program. In this sample program we will initialize some variables and print their values to the screen using the debug.print statement. Programming languages use programming statements to do things. A statement includes a command word called a keyword and values. The debug.print statement allows you to print out messages on the computer screen. Messages are string constants enclosed by " double quotes ". Here we use the Debug.Print statement to print "Hi, my name is Tom" message on the computer screen. programming statement Debug.Print "Hi, my name is Tom" keywords string message You can also use a variable to print out values to the screen. Debug.Print name Here is our example program: Dim name as String Dim age as Integer name = "Tom" age = 20 Debug.Print "Hi, my name is " Debug.Print name Debug.Print "I am now " Debug.Print age Debug.Print "years old." Before you can write and run this program you first need to create a new Project. Make sure you have Visual Basic installed on your computer. We are using Visual Basic version 6.0. Open up Visual Basic, the following window pops up, select Standard EXE then click on the Open button.
4 4 The VB IDE Integreated Development Environment now appears as shown below. You write your VB program using the IDE. Just follow these step by step Instructions: [1] Right-click on Form1 in the Project Explorer window and select Remove Form1 from the pop up window. (this is an optional step) [2] From the Project menu click Add Module. [3] Click on the Open button to create Module1, then double-click the Module1 icon on the Project Explorer window to open it. [4] Enter the following program in the Module1 window as shown below. Notice, the program starts with Sub Main() and ends with End Sub Sub Main() Dim name as String Dim age as Integer name = "Tom" age = 20 Debug.Print "Hi, my name is " Debug.Print name Debug.Print "I am now " Debug.Print age Debug.Print "years old." End Sub
5 5 [5] Click on the View menu and select Immediate Window. [6] Click the Run menu and then click Start (or press F5 to run the program). The output of the program is shown in the Immediate window.
6 6 Understanding the example program Lets go through each line of the example program one by one for understanding. We will put a comment on each line. Comments are used to explain program code, the comments are never executed. Comments start with a ' single quotation. ' This is a Comment Our comments will be in color green to be easily recognized. Comments may start at the beginning of a line or at the end of a programming statement. age = 20 ' assign the number 20 to the variable age Programs are made up of programming statements. Programming statements are grouped together in a Sub. Subs are put into modules. When the VB program starts to run it executes the statements one by one contained in the Sub. When the last statement is executed the program ends. All Subs need a name for identification. The name of our Sub is Main. The Main is the first sub to be executed when the program runs. A VB program can only have 1 main sub. The round brackets () following Main means Main is a sub. Round brackets () distinguish a sub name from a variable name. Names of subs and variables are known as identifiers. Sub main() ' contains program Dim name as String ' declare a string variable to represent a persons name Dim age as Integer ' declare an integer variable to represent a persons age name = "Tom" ' assign the string "Tom" to the variable name age = 20 ' assign the number 20 to the variable age Debug.Print "Hi, my name is " ' print a message to the screen Debug.Print name ' print to the screen the persons name Debug.Print "I am now " ' print a message to the screen Debug.Print age ' print to the screen the persons age Debug.Print "years old." ' print a message to the screen End Sub ' ends program The program output:
7 7 RENAMING PROJECTS AND MODULES Every time you make a project it gets a default name Project 1. Every time you add a module, it gets a default name like Module 1. You should give projects and modules meaningful names. It's easy to do. Just go to the project window click on the module and in the Module properties box change the name. To change a project name right click on the project, select project properties from the pop up menu and the following dialog box appears. Dialog boxes allow you to enter information. In VB programming you will be using dialog boxes all the time. You will also be writing your own dialog boxes. Dialog boxes are also called forms. project type set startup to Main project name
8 8 Saving your projects and modules You need to save all the modules of your project separately from the file menu. From the file menu select Save Project As and then Save Module As. You only need to use "Save As" once. Next time just use Save Project and save Module. Be careful, save project only saves the projects but not the modules. You always need to save everything. VB LESSON1 EXERCISE 1 Write a program that has 3 variables to display a person's name, address and phone number. Declare and assign values to these variables. Print out to the screen using Debug.Print. Call your VB project Project1 and call your module Module1 VARIANTS You may need a variable to represent any kind of data type. In this situation you may declare the data type as Variant. This means that the data type of the variable will depend on the value assigned to it. Dim s As Variant s = "Hello" The String constant "Hello" is assigned to the variable s. Later in the program, you may assign a number to s. s = 10 Variants may be confusing to some but to others it may be more convenient. Variants are also the default data type. Dim s s is now a variant. In VB, you can declare variables on the same line separated by commas. Dim x, y As Integer You must be very careful here! x is a variant where y is an Integer. To make both Integer you need to write the statement as Dim x As Integer, y As Integer CONSTANTS There are situations in a program where you need to assign a value to variable but you never ever want that variable to change. These variables are called constants and are also known as "read only". This means you can read the value again but you can never write a new value to it. You use the keyword const to specify that a variable will be a constant and initialize it with a value. Const Max = 10
9 9 Once you initialize the constant variable with a value it can never change. The constant is only available for use in your module. To let other modules use your constant you proceed the constant declaration with the Public keyword. Public Const Max = 10 Once you declare and initialize your constant you use it just like any variable. Dim x As Integer x = Max Now x has the value 10. Remember you can never assign new values to your constant variable. Max = 20 EXPLICIT OPTION It is not always necessary to use the Dim statement to declare variables. You can use variables right away. x = 10 It is advised that you declare variables before you use them. To make sure you declare every variable before you use it, you put the Option Explicit directive at the top of your program. Here's the last program example using Option Explicit Option Explicit Sub main() Dim name as String Dim age as Integer name = "Tom" age = 20 Debug.Print "Hi, my name is " Debug.Print name Debug.Print "I am now " Debug.Print age Debug.Print "years old." End Sub VB LESSON1 EXERCISE 2 Change your Exercise 1 to use Variants, Constants and the Explicit Option. Call your module Module2. You can put a second module in your project and in the Project Properties you can set the startup to this module. You will have to rename Main to Main1 in Module 1. If you run your program many times you need to clear the Immediate window. It retains all previous results. Just highlight all the entries and press the delete button, or right click on it using the mouse and select cut from the pop up menu.
10 10 INPUT BOX Your program will need to get data values from the keyboard. A good way to get data from the keyboard is to use an Input Box. These look very professionals and impressive. Each Input Box gets a prompt message to tell the user what to do. Once they enter the data they can click on the OK button or Cancel button. InputBox is a built in VB function. Built in functions are pre-defined code that you can use right away. Functions receive values and return values. Using built in functions let you program very fast. You need to know how to use built in functions. Every built in function has a syntax that specifies how to use it. The syntax for the Input Box function is a little overwhelming. InputBox (prompt[, title] [, default] [, xpos] [, ypos] [, helpfile, context]) Every function gets arguments. arguments are used to pass values to the function. The InputBox function needs the prompt message. The other arguments enclosed in square brackets [ ] are optional meaning you do not need to supply values for them. Here are the arguments and their descriptions. Don't be too concerned right now about all the arguments right now. Argument prompt title Description Required. String expression displayed as the message in the dialog box. The maximum length of prompt is approximately 1024 characters, depending on the width of the characters used. If prompt consists of more than one line, you can separate the lines using a carriage return character (Chr(13)), a linefeed character (Chr(10)), or carriage return linefeed character combination (Chr(13) & Chr(10)) between each line. Optional. String expression displayed in the title bar of the dialog box. If you omit title, the application name is placed in the title bar.
11 11 default xpos ypos helpfile context Optional. String expression displayed in the text box as the default response if no other input is provided. If you omit default, the text box is displayed empty. Optional. Numeric expression that specifies, in twips, the horizontal distance of the left edge of the dialog box from the left edge of the screen. If xpos is omitted, the dialog box is horizontally centered. Optional. Numeric expression that specifies, in twips, the vertical distance of the upper edge of the dialog box from the top of the screen. If ypos is omitted, the dialog box is vertically positioned approximately one-third of the way down the screen. Optional. String expression that identifies the Help file to use to provide contextsensitive Help for the dialog box. If helpfile is provided, context must also be provided. Optional. Numeric expression that is the Help context number assigned to the appropriate Help topic by the Help author. If context is provided, helpfile must also be provided. The following string constants can be used anywhere in your code in place of actual values: Constant Value Description vbcr Chr(13) Carriage return vbcrlf Chr(13) & Chr(10) Carriage return linefeed combination vbformfeed Chr(12) Form feed; not useful in Microsoft Windows vblf Chr(10) Line feed vbnewline Chr(13) & Chr(10) or Chr(10) vbnullchar Chr(0) Character having the value 0 vbnullstring String having value 0 Platform-specific newline character; whatever is appropriate for the platform Not the same as a zero-length string (""); used for calling external procedures vbtab Chr(9) Horizontal tab vbverticaltab Chr(11) Vertical tab; not useful in Microsoft Windows Functions receive values do a calculation and return the calculated value. It's easy to use the InputBox function, all you have to do is assign the function to a variable. The variable gets the value that the user has entered into the input box Dim name As String name = InputBox("What is your name?") Here's a sample program that asks someone for their name and then prints their name to the screen. Sub main() Dim name As String name = InputBox("What is your name?") Debug.Print "Your name is " & name End Sub
12 12 Here's the input box Here's the program output: VB LESSON1 EXERCISE 3 Change your exercise 2 to use an Input Box. Ask someone for their name, address and age. Call your module Module3. Rename the Main sub in Exercise 2 to Main2 MSG BOX A message box lets you display information in a window. The message box is displayed until the OK button is pressed. A Message Box function has the following syntax: MsgBox(prompt[, buttons] [, title] [, helpfile, context]) Again the optional supplied argument values are in square brackets[ ]. We just use prompt and title. Here are the descriptions of the named arguments: Part prompt buttons title helpfile context Description Required. String expression displayed as the message in the dialog box. The maximum length of prompt is approximately 1024 characters, depending on the width of the characters used. If prompt consists of more than one line, you can separate the lines using a carriage return character (Chr(13)), a linefeed character (Chr(10)), or carriage return linefeed character combination (Chr(13) & Chr(10)) between each line. Optional. Numeric expression that is the sum of values specifying the number and type of buttons to display, the icon style to use, the identity of the default button, and the modality of the message box. If omitted, the default value for buttons is 0. Optional. String expression displayed in the title bar of the dialog box. If you omit title, the application name is placed in the title bar. Optional. String expression that identifies the Help file to use to provide context-sensitive Help for the dialog box. If helpfile is provided, context must also be provided. Optional. Numeric expression that is the Help context number assigned to the appropriate Help topic by the Help author. If context is provided, helpfile must also be provided.
13 13 Settings The buttons argument settings are: Constant Value Description vbokonly 0 Display OK button only. vbokcancel 1 Display OK and Cancel buttons. vbabortretryignore 2 Display Abort, Retry, and Ignore buttons. vbyesnocancel 3 Display Yes, No, and Cancel buttons. vbyesno 4 Display Yes and No buttons. vbretrycancel 5 Display Retry and Cancel buttons. vbcritical 16 Display Critical Message icon. vbquestion 32 Display Warning Query icon. vbexclamation 48 Display Warning Message icon. vbinformation 64 Display Information Message icon. vbdefaultbutton1 0 First button is default. vbdefaultbutton2 256 Second button is default. vbdefaultbutton3 512 Third button is default. vbdefaultbutton4 768 Fourth button is default. vbapplicationmodal 0 Application modal; the user must respond to the message box before continuing work in the current application. vbsystemmodal 4096 System modal; all applications are suspended until the user responds to the message box. vbmsgboxhelpbutton Adds Help button to the message box VbMsgBoxSetForegro und Specifies the message box window as the foreground window vbmsgboxright Text is right aligned Specifies text should appear as right-to-left vbmsgboxrtlreading reading on Hebrew and Arabic systems The first group of values (0 5) describes the number and type of buttons displayed in the dialog box; the second group (16, 32, 48, 64) describes the icon style; the third group (0, 256, 512) determines which button is the default; and the fourth group (0, 4096) determines the modality of the message box. When adding numbers to create a final value for the buttons argument, use only one number from each group. Note these constants are specified by Visual Basic for Applications. As a result, the names can be used anywhere in your code in place of the actual values. Return Values Constant Value Description vbok 1 OK vbcancel 2 Cancel vbabort 3 Abort vbretry 4 Retry vbignore 5 Ignore vbyes 6 Yes vbno 7 No
14 14 Remarks When both helpfile and context are provided, the user can press F1 to view the Help topic corresponding to the context. Some host applications, for example, Microsoft Excel, also automatically add a Help button to the dialog box. If the dialog box displays a Cancel button, pressing the ESC key has the same effect as clicking Cancel. If the dialog box contains a Help button, context-sensitive Help is provided for the dialog box. However, no value is returned until one of the other buttons is clicked. Note To specify more than the first named argument, you must use MsgBox in an expression. To omit some positional arguments, you must include the corresponding comma delimiter Here's our example program using a MsgBox Sub Main() Dim name As String name = InputBox("What is your name?") MsgBox "Your name is " & name End Sub Notice we use the '&' operator to join a message and a variable value. Operators are used to do operations with variables. The '&' can also be used to join strings together but not two numeric values. VB LESSON1 EXERCISE 4 Change your exercise 1 to use include a MsgBox. Ask the user to enter their name, address and age using the Input Box and then display them in a MsgBox. Use a line feed character Chr(10) or Vbcrlf to separate lines in the MsgBox. Call your module Module4 ARRAYS Arrays represent many variables of the same data type all accessed using a common name. Each variable of the array is known as a cell or element. x x0 x1 x2 x3 x4 You may want to use an array to record temperature of every hour for a certain day. temps It's easy to make an array you just declare a variable stating a lower bound and an upper bound. Dim a(0 to 4) as Integer Dim ( lowerbound to upperbound ) The lowerbound starts at 0 and can be omitted. Dim a(4)
15 15 Once you declare your array you can store values in it, this is known as accessing. You access the array cell elements by an index. Each cell element in the array is located using an index. a(2) = 5 Our declared array has 5 elements with indexes from 0 to 4. The value 5 will be located at index You can get the value from an array by specifying the array element index and assign the value at he specified index to another variable, Dim x as Integer x = a(2) Now variable x has the value 5. Arrays of 1 row are known as 1 dimensional arrays. VB LESSON1 EXERCISE 5 array name index value Declare a 1 dimensional array of 5 elements to store string values. Get 5 different names using an Input Box and store in the array. Using another Input Box ask the user to type in a number between 1 to 5. Display the name corresponding to the number in a MsgBox. Call your module Module5. Warning to not declare an array as name(4). Some people like their arrays to start at 1 rather than 0. Use the following statement at the top of your program to make all arrays to start at lower bound 1. Option base 1 2 dimensional arrays An array may have many rows and columns these arrays are known as 2 dimensional arrays, there are now two dimension rows and columns. To declare a two dimensional array you must declare the number of rows and columns. columns dim b ( 2, 3) As Integer rows rows columns
16 16 You assign values to the array cells by specifying row and column indexes row b(1, 2) = 5 column columns rows VB LESSON1 EXERCISE 6 Declare a 2 dimensional array of 4 rows and two columns. Using an Input Box ask the user for 4 names. Store each name in the first column of each row. For each name ask the user their favorite hobby, using an InputBox. Store the hobby in the second column of each row. Ask the user to type in a number between 1 and 4. using an Input Box. Display the person's name and hobby in a Message Box. Call your module Module6
17 17 IMPORTANT You should use all the material in all the lessons to do the questions and exercises. If you do not know how to do something or have to use additional books or references to do the questions or exercises, please let us know immediately. We want to have all the required information in our lessons. By letting us know we can add the required information to the lessons. The lessons are updated on a daily bases. We call our lessons the "living lessons". Please let us keep our lessons alive. all typos, unclear test, and additional information required to: courses@cstutoring.com all attached files of your completed exercises to: Order your next lesson from: students@cstutoring.com This lesson is copyright (C) 2002 by The Computer Science Tutoring Center " This document is not to be copied or reproduced in any form. For use of student only
Understanding the MsgBox command in Visual Basic
Understanding the MsgBox command in Visual Basic This VB2008 tutorial explains how to use the MsgBox function in Visual Basic. This also works for VBS MsgBox. The MsgBox function displays a message in
More informationProgramming Concepts and Skills. Arrays continued and Functions
Programming Concepts and Skills Arrays continued and Functions Fixed-Size vs. Dynamic Arrays A fixed-size array has a limited number of spots you can place information in. Dim strcdrack(0 to 2) As String
More informationIFA/QFN VBA Tutorial Notes prepared by Keith Wong
Chapter 2: Basic Visual Basic programming 2-1: What is Visual Basic IFA/QFN VBA Tutorial Notes prepared by Keith Wong BASIC is an acronym for Beginner's All-purpose Symbolic Instruction Code. It is a type
More informationMICROSOFT EXCEL 2000 LEVEL 5 VBA PROGRAMMING INTRODUCTION
MICROSOFT EXCEL 2000 LEVEL 5 VBA PROGRAMMING INTRODUCTION Lesson 1 - Recording Macros Excel 2000: Level 5 (VBA Programming) Student Edition LESSON 1 - RECORDING MACROS... 4 Working with Visual Basic Applications...
More informationAn InputBox( ) function will display an input Box window where the user can enter a value or a text. The format is
InputBox( ) Function An InputBox( ) function will display an input Box window where the user can enter a value or a text. The format is A = InputBox ( Question or Phrase, Window Title, ) Example1: Integer:
More informationExcel & Visual Basic for Applications (VBA)
Class meeting #18 Monday, Oct. 26 th GEEN 1300 Introduction to Engineering Computing Excel & Visual Basic for Applications (VBA) user interfaces o on-sheet buttons o InputBox and MsgBox functions o userforms
More information3 IN THIS CHAPTER. Understanding Program Variables
Understanding Program Variables Your VBA procedures often need to store temporary values for use in statements and calculations that come later in the code. For example, you might want to store values
More informationINFORMATICS: Computer Hardware and Programming in Visual Basic 81
INFORMATICS: Computer Hardware and Programming in Visual Basic 81 Chapter 3 THE REPRESENTATION OF PROCESSING ALGORITHMS... 83 3.1 Concepts... 83 3.1.1 The Stages of Solving a Problem by Means of Computer...
More information6/14/2010. VBA program units: Subroutines and Functions. Functions: Examples: Examples:
VBA program units: Subroutines and Functions Subs: a chunk of VBA code that can be executed by running it from Excel, from the VBE, or by being called by another VBA subprogram can be created with the
More informationVisual Programming 1. What is Visual Basic? 2. What are different Editions available in VB? 3. List the various features of VB
Visual Programming 1. What is Visual Basic? Visual Basic is a powerful application development toolkit developed by John Kemeny and Thomas Kurtz. It is a Microsoft Windows Programming language. Visual
More informationMICROSOFT EXCEL VISUAL BASIC FOR APPLICATIONS INTERMEDIATE
MICROSOFT EXCEL VISUAL BASIC FOR APPLICATIONS INTERMEDIATE NOTE Unless otherwise stated, screenshots of dialog boxes and screens in this book were taken using Excel 2003 running on Window XP Professional.
More informationVBA. VBA at a glance. Lecture 61
VBA VBA at a glance Lecture 61 1 Activating VBA within SOLIDWORKS Lecture 6 2 VBA Sub main() Function Declaration Dim A, B, C, D, E As Double Dim Message, Title, Default Message = "A : " ' Set prompt.
More informationExcel Macro Record and VBA Editor. Presented by Wayne Wilmeth
Excel Macro Record and VBA Editor Presented by Wayne Wilmeth 1 What Is a Macro? Automates Repetitive Tasks Written in Visual Basic for Applications (VBA) Code Macro Recorder VBA Editor (Alt + F11) 2 Executing
More informationd2vbaref.doc Page 1 of 22 05/11/02 14:21
Database Design 2 1. VBA or Macros?... 2 1.1 Advantages of VBA:... 2 1.2 When to use macros... 3 1.3 From here...... 3 2. A simple event procedure... 4 2.1 The code explained... 4 2.2 How does the error
More informationData Types Literals, Variables & Constants
VISUAL BASIC Data Types Literals, Variables & Constants Copyright 2013 Dan McElroy Under the Hood As a DRIVER of an automobile, you may not need to know everything that happens under the hood, although
More informationCreating Macros David Giusto, Technical Services Specialist, Synergy Resources
Creating Macros David Giusto, Technical Services Specialist, Synergy Resources Session Background Ever want to automate a repetitive function or have the system perform calculations that you may be doing
More informationC# INTRODUCTION. Object. Car. data. red. moves. action C# PROGRAMMERS GUIDE LESSON 1. CsGuideL1.doc. Date Started: May 8,2001
1 C# PROGRAMMERS GUIDE LESSON 1 File: CsGuideL1.doc Date Started: May 8,2001 Last Update: Aug 10, 2006 Version 2003-2005 C# INTRODUCTION This manual introduces the C# programming language techniques and
More informationJAVA PROGRAMMERS GUIDE LESSON
1 JAVA PROGRAMMERS GUIDE LESSON 1 File: JavaL1.doc Date Started: July 12,1998 Last Update: Dec 28, 2005 Java Version: 1.5 INTRODUCTION This manual introduces the Java programming language techniques and
More informationUsing Microsoft Excel
Using Microsoft Excel Formatting a spreadsheet means changing the way it looks to make it neater and more attractive. Formatting changes can include modifying number styles, text size and colours. Many
More informationLearning Worksheet Fundamentals
1.1 LESSON 1 Learning Worksheet Fundamentals After completing this lesson, you will be able to: Create a workbook. Create a workbook from a template. Understand Microsoft Excel window elements. Select
More informationMicrosoft Excel 2010 Basics
Microsoft Excel 2010 Basics Starting Word 2010 with XP: Click the Start Button, All Programs, Microsoft Office, Microsoft Excel 2010 Starting Word 2010 with 07: Click the Microsoft Office Button with the
More informationWEEK NO. 12 MICROSOFT EXCEL 2007
WEEK NO. 12 MICROSOFT EXCEL 2007 LESSONS OVERVIEW: GOODBYE CALCULATORS, HELLO SPREADSHEET! 1. The Excel Environment 2. Starting A Workbook 3. Modifying Columns, Rows, & Cells 4. Working with Worksheets
More informationProgramming with visual Basic:
Programming with visual Basic: 1-Introdution to Visual Basics 2-Forms and Control tools. 3-Project explorer, properties and events. 4-make project, save it and its applications. 5- Files projects and exercises.
More informationChapter 3: The IF Function and Table Lookup
Chapter 3: The IF Function and Table Lookup Objectives This chapter focuses on the use of IF and LOOKUP functions, while continuing to introduce other functions as well. Here is a partial list of what
More informationSébastien Mathier wwwexcel-pratiquecom/en Variables : Variables make it possible to store all sorts of information Here's the first example : 'Display the value of the variable in a dialog box 'Declaring
More informationGCSE CCEA GCSE EXCEL 2010 USER GUIDE. Business and Communication Systems
GCSE CCEA GCSE EXCEL 2010 USER GUIDE Business and Communication Systems For first teaching from September 2017 Contents Page Define the purpose and uses of a spreadsheet... 3 Define a column, row, and
More informationIntroduction to Data Entry and Data Types
212 Chapter 4 Variables and Arithmetic Operations STEP 1 With the Toolbox visible (see Figure 4-21), click the Toolbox Close button. The Toolbox closes and the work area expands in size.to reshow the Toolbox
More informationUsing Microsoft Excel
Using Microsoft Excel in Excel Although calculations are one of the main uses for spreadsheets, Excel can do most of the hard work for you by using a formula. When you enter a formula in to a spreadsheet
More informationUsing Microsoft Excel
Using Microsoft Excel Excel contains numerous tools that are intended to meet a wide range of requirements. Some of the more specialised tools are useful to only certain types of people while others have
More informationStudy Guide. PCIC 3 B2 GS3- Key Applications-Excel. Copyright 2010 Teknimedia Corporation
Study Guide PCIC 3 B2 GS3- Key Applications-Excel Copyright 2010 Teknimedia Corporation Teknimedia grants permission to any licensed owner of PCIC 3 B GS3 Key Applications-Excel to duplicate the contents
More informationFull file at Excel Chapter 2 - Formulas, Functions, Formatting, and Web Queries
Excel Chapter 2 - Formulas, Functions, Formatting, and Web Queries MULTIPLE CHOICE 1. To start a new line in a cell, press after each line, except for the last line, which is completed by clicking the
More informationBASIC MACROINSTRUCTIONS (MACROS)
MS office offers a functionality of building complex actions and quasi-programs by means of a special scripting language called VBA (Visual Basic for Applications). In this lab, you will learn how to use
More informationCS242 COMPUTER PROGRAMMING
CS242 COMPUTER PROGRAMMING I.Safa a Alawneh Variables Outline 2 Data Type C++ Built-in Data Types o o o o bool Data Type char Data Type int Data Type Floating-Point Data Types Variable Declaration Initializing
More informationIT 374 C# and Applications/ IT695 C# Data Structures
IT 374 C# and Applications/ IT695 C# Data Structures Module 2.1: Introduction to C# App Programming Xianrong (Shawn) Zheng Spring 2017 1 Outline Introduction Creating a Simple App String Interpolation
More informationEXCEL 2007 TIP SHEET. Dialog Box Launcher these allow you to access additional features associated with a specific Group of buttons within a Ribbon.
EXCEL 2007 TIP SHEET GLOSSARY AutoSum a function in Excel that adds the contents of a specified range of Cells; the AutoSum button appears on the Home ribbon as a. Dialog Box Launcher these allow you to
More informationIFA/QFN VBA Tutorial Notes prepared by Keith Wong
IFA/QFN VBA Tutorial Notes prepared by Keith Wong Chapter 5: Excel Object Model 5-1: Object Browser The Excel Object Model contains thousands of pre-defined classes and constants. You can view them through
More informationLes s on Objectives. Student Files Us ed. Student Files Crea ted
Lesson 10 - Pivot Tables 103 Lesson 10 P ivot T ables Les s on Topics Creating a Pivot Table Exercise: Creating a Balance Summary Formatting a Pivot Table Creating a Calculated Field Les s on Objectives
More informationVISUAL BASIC 6.0 OVERVIEW
VISUAL BASIC 6.0 OVERVIEW GENERAL CONCEPTS Visual Basic is a visual programming language. You create forms and controls by drawing on the screen rather than by coding as in traditional languages. Visual
More informationVBA Collections A Group of Similar Objects that Share Common Properties, Methods and
VBA AND MACROS VBA is a major division of the stand-alone Visual Basic programming language. It is integrated into Microsoft Office applications. It is the macro language of Microsoft Office Suite. Previously
More informationDOING MORE WITH EXCEL: MICROSOFT OFFICE 2013
DOING MORE WITH EXCEL: MICROSOFT OFFICE 2013 GETTING STARTED PAGE 02 Prerequisites What You Will Learn MORE TASKS IN MICROSOFT EXCEL PAGE 03 Cutting, Copying, and Pasting Data Basic Formulas Filling Data
More informationAlternatives To Custom Dialog Box
Alternatives To Custom Dialog Box Contents VBA Input Box Syntax & Function The Excel InputBox method Syntax The VBA MsgBox Function The Excel GetOpenFilename Method The Excel GetSaveAsFilename Method Reference
More informationExcel 2010: Getting Started with Excel
Excel 2010: Getting Started with Excel Excel 2010 Getting Started with Excel Introduction Page 1 Excel is a spreadsheet program that allows you to store, organize, and analyze information. In this lesson,
More informationLecture- 5. Introduction to Microsoft Excel
Lecture- 5 Introduction to Microsoft Excel The Microsoft Excel Window Microsoft Excel is an electronic spreadsheet. You can use it to organize your data into rows and columns. You can also use it to perform
More informationMicrosoft Access II 1.) Opening a Saved Database Music Click the Options Enable this Content Click OK. *
Microsoft Access II 1.) Opening a Saved Database Open the Music database saved on your computer s hard drive. *I added more songs and records to the Songs and Artist tables. Click the Options button next
More informationFull file at
Java Programming: From Problem Analysis to Program Design, 3 rd Edition 2-1 Chapter 2 Basic Elements of Java At a Glance Instructor s Manual Table of Contents Overview Objectives s Quick Quizzes Class
More informationExcel Select a template category in the Office.com Templates section. 5. Click the Download button.
Microsoft QUICK Excel 2010 Source Getting Started The Excel Window u v w z Creating a New Blank Workbook 2. Select New in the left pane. 3. Select the Blank workbook template in the Available Templates
More informationSoftware Reference Sheet: Inserting and Organizing Data in a Spreadsheet
Inserting and formatting text Software Reference Sheet: Inserting and Organizing Data in a Spreadsheet Column headings are very important to include in your spreadsheet so that you can remember what the
More informationObject Oriented Programming with Visual Basic.Net
Object Oriented Programming with Visual Basic.Net By: Dr. Hossein Hakimzadeh Computer Science and Informatics IU South Bend (c) Copyright 2007 to 2015 H. Hakimzadeh 1 What do we need to learn in order
More informationExcel Expert Microsoft Excel 2010
Excel Expert Microsoft Excel 2010 Formulas & Functions Table of Contents Excel 2010 Formulas & Functions... 2 o Formula Basics... 2 o Order of Operation... 2 Conditional Formatting... 2 Cell Styles...
More informationVBA Excel 2013/2016. VBA Visual Basic for Applications. Learner Guide
VBA Visual Basic for Applications Learner Guide 1 Table of Contents SECTION 1 WORKING WITH MACROS...5 WORKING WITH MACROS...6 About Excel macros...6 Opening Excel (using Windows 7 or 10)...6 Recognizing
More informationExcel Tables and Pivot Tables
A) Why use a table in the first place a. Easy to filter and sort if you only sort or filter by one item b. Automatically fills formulas down c. Can easily add a totals row d. Easy formatting with preformatted
More informationprintf( Please enter another number: ); scanf( %d, &num2);
CIT 593 Intro to Computer Systems Lecture #13 (11/1/12) Now that we've looked at how an assembly language program runs on a computer, we're ready to move up a level and start working with more powerful
More informationTable of Contents Data Validation... 2 Data Validation Dialog Box... 3 INDIRECT function... 3 Cumulative List of Keyboards Throughout Class:...
Highline Excel 2016 Class 10: Data Validation Table of Contents Data Validation... 2 Data Validation Dialog Box... 3 INDIRECT function... 3 Cumulative List of Keyboards Throughout Class:... 4 Page 1 of
More informationGroup sheets 2, 3, 4, and 5 1. Click on SHEET Hold down the CMD key and as you continue to hold it down, click on sheets 3, 4, and 5.
Data Entry, Cell Formatting, and Cell Protection in Excel 2004 In this workshop, you start by adding to the number of sheets in your workbook and then grouping four of the sheets to set up a small spreadsheet
More informationFull file at
Java Programming, Fifth Edition 2-1 Chapter 2 Using Data within a Program At a Glance Instructor s Manual Table of Contents Overview Objectives Teaching Tips Quick Quizzes Class Discussion Topics Additional
More informationUsing Microsoft Excel
Using Microsoft Excel Excel contains numerous tools that are intended to meet a wide range of requirements. Some of the more specialised tools are useful to people in certain situations while others have
More information13 FORMATTING WORKSHEETS
13 FORMATTING WORKSHEETS 13.1 INTRODUCTION Excel has a number of formatting options to give your worksheets a polished look. You can change the size, colour and angle of fonts, add colour to the borders
More informationBeginning Excel. Revised 4/19/16
Beginning Excel Objectives: The Learner will: Become familiar with terminology used in Microsoft Excel Create a simple workbook Write a simple formula Formatting Cells Adding Columns Borders Table of Contents:
More informationExcel VBA Programming
Exclusive Study Manual Excel VBA Programming Advanced Excel Study Notes (For Private Circulation Only Not For Sale) 7208669962 8976789830 (022 ) 28114695 www.laqshya.in info@laqshya.in Study Notes Excel
More informationcar object properties data red travels at 50 mph actions functions containing programming statements Program Program variables functions
1 C++ PROGRAMMERS GUIDE LESSON 1 File: CppGuideL1.doc Date Started: July 12,1998 Last Update: Mar 21, 2002 Version: 4.0 INTRODUCTION This manual will introduce the C++ Programming Language techniques and
More informationFormatting Worksheets
140 :: Data Entry Operations 7 Formatting Worksheets 7.1 INTRODUCTION Excel makes available numerous formatting options to give your worksheet a polished look. You can change the size, colour and angle
More informationExcel 2010 Foundation. Excel 2010 Foundation SAMPLE
Excel 2010 Foundation Excel 2010 Foundation Excel 2010 Foundation Page 2 2010 Cheltenham Courseware Pty. Ltd. All trademarks acknowledged. E&OE. No part of this document may be copied without written permission
More informationEx: If you use a program to record sales, you will want to remember data:
Data Variables Programs need to remember values. Ex: If you use a program to record sales, you will want to remember data: A loaf of bread was sold to Sione Latu on 14/02/19 for T$1.00. Customer Name:
More informationDOING MORE WITH EXCEL: MICROSOFT OFFICE 2010
DOING MORE WITH EXCEL: MICROSOFT OFFICE 2010 GETTING STARTED PAGE 02 Prerequisites What You Will Learn MORE TASKS IN MICROSOFT EXCEL PAGE 03 Cutting, Copying, and Pasting Data Filling Data Across Columns
More informationMicrosoft Word. Part 2. Hanging Indent
Microsoft Word Part 2 Hanging Indent 1 The hanging indent feature indents each line except the first line by the amount specified in the By field in the Paragraph option under the format option, as shown
More informationOutline. Midterm Review. Using Excel. Midterm Review: Excel Basics. Using VBA. Sample Exam Question. Midterm Review April 4, 2014
Midterm Review Larry Caretto Mechanical Engineering 209 Computer Programming for Mechanical Engineers April 4, 2017 Outline Excel spreadsheet basics Use of VBA functions and subs Declaring/using variables
More informationChapter 2 Using Data. Instructor s Manual Table of Contents. At a Glance. Overview. Objectives. Teaching Tips. Quick Quizzes. Class Discussion Topics
Java Programming, Sixth Edition 2-1 Chapter 2 Using Data At a Glance Instructor s Manual Table of Contents Overview Objectives Teaching Tips Quick Quizzes Class Discussion Topics Additional Projects Additional
More informationCreate your first workbook
Create your first workbook You've been asked to enter data in Excel, but you've never worked with Excel. Where do you begin? Or perhaps you have worked in Excel a time or two, but you still wonder how
More informationUsing Custom Number Formats
APPENDIX B Using Custom Number Formats Although Excel provides a good variety of built-in number formats, you may find that none of these suits your needs. This appendix describes how to create custom
More information1 THE PNP BASIC COMPUTER ESSENTIALS e-learning (MS Excel 2007)
1 THE PNP BASIC COMPUTER ESSENTIALS e-learning (MS Excel 2007) 2 THE PNP BASIC COMPUTER ESSENTIALS e-learning (MS Excel 2007) TABLE OF CONTENTS CHAPTER 1: GETTING STARTED... 5 THE EXCEL ENVIRONMENT...
More informationMicrosoft Excel Level 1
Microsoft Excel 2010 Level 1 Copyright 2010 KSU Department of Information Technology Services This document may be downloaded, printed, or copied for educational use without further permission of the Information
More informationOpen Book Format.docx. Headers and Footers. Microsoft Word Part 3 Office 2016
Microsoft Word Part 3 Office 2016 Open Book Format.docx Headers and Footers If your document has a page number, you already have a header or footer (and can double click on it to open it). If you did not
More informationBasic Microsoft Excel 2011
Basic Microsoft Excel 2011 Table of Contents Starting Excel... 2 Creating a New Workbook... 3 Saving a Workbook... 3 Creating New Worksheets... 3 Renaming a Worksheet... 3 Deleting a Worksheet... 3 Selecting
More informationCandy is Dandy Project (Project #12)
Candy is Dandy Project (Project #12) You have been hired to conduct some market research about M&M's. First, you had your team purchase 4 large bags and the results are given for the contents of those
More informationAs an A+ Certified Professional, you will want to use the full range of
Bonus Chapter 1: Creating Automation Scripts In This Chapter Understanding basic programming techniques Introducing batch file scripting Introducing VBScript Introducing PowerShell As an A+ Certified Professional,
More informationIntroduction to Excel 2007
Introduction to Excel 2007 These documents are based on and developed from information published in the LTS Online Help Collection (www.uwec.edu/help) developed by the University of Wisconsin Eau Claire
More informationNOTES: Variables & Constants (module 10)
Computer Science 110 NAME: NOTES: Variables & Constants (module 10) Introduction to Variables A variable is like a container. Like any other container, its purpose is to temporarily hold or store something.
More informationIntroduction to Programming in Turing. Input, Output, and Variables
Introduction to Programming in Turing Input, Output, and Variables The IPO Model The most basic model for a computer system is the Input-Processing-Output (IPO) Model. In order to interact with the computer
More informationJME Language Reference Manual
JME Language Reference Manual 1 Introduction JME (pronounced jay+me) is a lightweight language that allows programmers to easily perform statistic computations on tabular data as part of data analysis.
More informationApplication of Skills: Microsoft Excel 2013 Tutorial
Application of Skills: Microsoft Excel 2013 Tutorial Throughout this module, you will progress through a series of steps to create a spreadsheet for sales of a club or organization. You will continue to
More informationTransform data - Compute Variables
Transform data - Compute Variables Contents TRANSFORM DATA - COMPUTE VARIABLES... 1 Recode Variables... 3 Transform data - Compute Variables With MAXQDA Stats you can perform calculations on a selected
More informationI OFFICE TAB... 1 RIBBONS & GROUPS... 2 OTHER SCREEN PARTS... 4 APPLICATION SPECIFICATIONS... 5 THE BASICS...
EXCEL 2010 BASICS Microsoft Excel I OFFICE TAB... 1 RIBBONS & GROUPS... 2 OTHER SCREEN PARTS... 4 APPLICATION SPECIFICATIONS... 5 THE BASICS... 6 The Mouse... 6 What Are Worksheets?... 6 What is a Workbook?...
More informationOpening a Data File in SPSS. Defining Variables in SPSS
Opening a Data File in SPSS To open an existing SPSS file: 1. Click File Open Data. Go to the appropriate directory and find the name of the appropriate file. SPSS defaults to opening SPSS data files with
More informationExcel 2016 Basics for Windows
Excel 2016 Basics for Windows Excel 2016 Basics for Windows Training Objective To learn the tools and features to get started using Excel 2016 more efficiently and effectively. What you can expect to learn
More informationActivity: page 1/10 Introduction to Excel. Getting Started
Activity: page 1/10 Introduction to Excel Excel is a computer spreadsheet program. Spreadsheets are convenient to use for entering and analyzing data. Although Excel has many capabilities for analyzing
More informationLecture 05 I/O statements Printf, Scanf Simple statements, Compound statements
Programming, Data Structures and Algorithms Prof. Shankar Balachandran Department of Computer Science and Engineering Indian Institute of Technology, Madras Lecture 05 I/O statements Printf, Scanf Simple
More informationIntroduction to Excel 2007
Introduction to Excel 2007 Excel 2007 is a software program that creates a spreadsheet. It permits the user to enter data and formulas to perform mathematical and Boolean (comparison) calculations on the
More informationIntroduction to the C++ Programming Language
LESSON SET 2 Introduction to the C++ Programming Language OBJECTIVES FOR STUDENT Lesson 2A: 1. To learn the basic components of a C++ program 2. To gain a basic knowledge of how memory is used in programming
More information28 Simply Confirming On-site Status
28 Simply Confirming On-site Status 28.1 This chapter describes available monitoring tools....28-2 28.2 Monitoring Operational Status...28-5 28.3 Monitoring Device Values... 28-11 28.4 Monitoring Symbol
More informationIntroduction to CS Dealing with tables in Word Jacek Wiślicki, Laurent Babout,
Most word processors offer possibility to draw and format even very sophisticated tables. A table consists of rows and columns, forming cells. Cells can be split and merged together. Content of each cell
More informationChapter 2. Formulas, Functions, and Formatting
Chapter 2 Formulas, Functions, and Formatting Syntax of List Functions Functions and formulas always start with an equal sign, = Colon means through : List inside of parentheses =AVERAGE(A1:A5) Name of
More information3/31/2016. Spreadsheets. Spreadsheets. Spreadsheets and Data Management. Unit 3. Can be used to automatically
MICROSOFT EXCEL and Data Management Unit 3 Thursday March 31, 2016 Allow users to perform simple and complex sorting Allow users to perform calculations quickly Organizes and presents figures that can
More informationSeparate Text Across Cells The Convert Text to Columns Wizard can help you to divide the text into columns separated with specific symbols.
Chapter 7 Highlights 7.1 The Use of Formulas and Functions 7.2 Creating Charts 7.3 Using Chart Toolbar 7.4 Changing Source Data of a Chart Separate Text Across Cells The Convert Text to Columns Wizard
More informationAdd Bullets and Numbers
. Lesson 5: Adding Bullets and Numbers, If you have lists of data, you may want to bullet or number them. When using Microsoft Word, bulleting and numbering are easy. The first part of this lesson teaches
More informationUsing Advanced Options 14
Using Advanced Options 14 LESSON SKILL MATRIX Skill Exam Objective Objective Number Customizing Word K E Y T E R M S metadata GlobalStock/iStockphoto 459 460 Lesson 14 GlobalStock/iStockphoto You are employed
More informationExcel Intermediate
Excel 2013 - Intermediate (103-124) Advanced Functions Quick Links Range Names Pages EX394 EX407 Data Validation Pages EX410 EX419 VLOOKUP Pages EX176 EX179 EX489 EX500 IF Pages EX172 EX176 EX466 EX489
More informationExcel Foundation Quick Reference (Windows PC)
Excel Foundation Quick Reference (Windows PC) See https://staff.brighton.ac.uk/is/training/pages/excel/foundation.aspx for videos and exercises to accompany this quick reference card. Structure of a spreadsheet
More information3 The Building Blocks: Data Types, Literals, and Variables
chapter 3 The Building Blocks: Data Types, Literals, and Variables 3.1 Data Types A program can do many things, including calculations, sorting names, preparing phone lists, displaying images, validating
More informationThe toolbars at the top are the standard toolbar and the formatting toolbar.
Lecture 8 EXCEL Excel is a spreadsheet (all originally developed for bookkeeping and accounting). It is very useful for any mathematical or tabular operations. It allows you to make quick changes in input
More informationHOUR 12. Adding a Chart
HOUR 12 Adding a Chart The highlights of this hour are as follows: Reasons for using a chart The chart elements The chart types How to create charts with the Chart Wizard How to work with charts How to
More information