ME 142 Engineering Computation I Variables, Equations & Functions Introduction to Basic Programming Language.

Slides:



Advertisements
Similar presentations
Introduction to Macro Introduction to Visual Basic for Application Recording a Macro Looking at the code of Recorded Macro.
Advertisements

Office 2003 Post-Advanced Concepts and Techniques M i c r o s o f t Excel Project 7 Using Macros and Visual Basic for Applications (VBA) with Excel.
Using Macros and Visual Basic for Applications (VBA) with Excel
Tutorial 7: Developing an Excel Application
Tutorial 8: Developing an Excel Application
XP New Perspectives on Microsoft Excel 2003, Second Edition- Tutorial 8 1 Microsoft Office Excel 2003 Tutorial 8 – Developing an Excel Application.
Microsoft Office Excel 2013 Core Microsoft Office Excel 2013 Core Courseware # 3253 Lesson 8: Macros, Importing and Exporting Data.
With Microsoft Excel 2010 © 2011 Pearson Education, Inc. Publishing as Prentice Hall1 PowerPoint Presentation to Accompany GO! with Microsoft ® Excel 2010.
Programming in Visual Basic
Solve Equations with Exponents In addition to level 3.0 and above and beyond what was taught in class, students may: - Make connection with other.
Macros in Excel Intro to lab 1. Macroinstructions Macro is recorded in VBA module sequence of Excel operations Macros can automate tasks in Excel Macro.
Excel Lesson 14 Creating and Using Macros Microsoft Office 2010 Advanced Cable / Morrison 1.
Solving 2-step equations ax + b = c. Keep it balanced Just like when solving a one- step equation keep it balanced. Just like when solving a one- step.
COMPREHENSIVE Excel Tutorial 8 Developing an Excel Application.
Copyright © 2008 Pearson Prentice Hall. All rights reserved. 1 Macros and VBA A macro is a set of instructions that tells Excel which commands to execute.
ME 142 Engineering Computation I Macros. Key Concepts Macro Overview Recording a Macro Running a Macro Editing a Macro Using Controls.
 When I subtract a negative number, I am actually _____ the _______.
Instructor: Professor Cora Martinez, PhD Department of Civil and Environmental Engineering Florida International University.
Microsoft Excel 2007 © Wiley Publishing All Rights Reserved. The L Line The Express Line to Learning L Line.
11 10/10/2005 BAE Spreadsheet Macros (Visual Basic for Applications) Slides to accompany an in-class demo of spreadsheet technique: Macro Programming.
Copyright 2007, Paradigm Publishing Inc. EXCEL 2007 Chapter 7 BACKNEXTEND 7-1 LINKS TO OBJECTIVES Record & run a macro Record & run a macro Save as a macro-
Automating Tasks with Visual Basic. Introduction  When can’t find a readymade macro action that does the job you want, you can use Visual Basic code.
Microsoft Excel Macros & Excel Solver (IENG490)
Introduction to VBA MGMI Aug What is VBA? VBA = Visual Basic for Application Excel’s powerful built-in programming language An event-driven.
® Microsoft Access 2010 Tutorial 11 Using and Writing Visual Basic for Applications Code.
Copyright © 2008 Pearson Prentice Hall. All rights reserved. 1 Microsoft Office Excel Copyright © 2008 Pearson Prentice Hall. All rights reserved
Introduction to Video Game Programming (VGP) Mr. Shultz.
Ch 1.3 – Order of Operations
ME 142 Engineering Computation I Macros. Key Concepts Macro Overview Recording a Macro Running a Macro Editing a Macro.
Bullet-Proofing your Excel Spreadsheets Tech Day 2013 Presentation.
Getting Started with MATLAB 1. Fundamentals of MATLAB 2. Different Windows of MATLAB 1.
CMPS 1371 Introduction to Computing for Engineers MatLab.
ME 142 Engineering Computation I Debugging Techniques.
Chapter 3 MATLAB Fundamentals Introduction to MATLAB Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
PROPERTIES OF EXPONENTS
ME 142 Engineering Computation I Using Subroutines Effectively.
Visual Basic for Application - Microsoft Access 2003 Programming applications using Objects.
A lesson approach © 2011 The McGraw-Hill Companies, Inc. All rights reserved. Microsoft® Excel 2013.
Array Operations ENGR 1181 MATLAB 4.
One step equations Add Subtract Multiply Divide  When we solve an equation, our goal is to isolate our variable by using our inverse operations.  What.
Variables and the Assignment Statement. Basics of Variables To represent any values that a process needs to remember, we use variables Recall that variables.
ME 142 Engineering Computation I Using Subroutines Effectively.
ME 142 Engineering Computation I Matrix Operations in Excel.
Introduction to Microsoft Excel Macros COE 201- Computer Proficiency.
ME 142 Engineering Computation I Using Excel Arrays in Functions.
I.I Order of Operations. I.I Order of Operations Objective Essential Question Key Vocab.  To learn the order of operations used with equations of mixed.
ME 142 Engineering Computation I Input, Output & Documentation.
I’m Thinking of a Number
Mathematical Formulas and Excel
A lesson approach © 2011 The McGraw-Hill Companies, Inc. All rights reserved. Microsoft® Excel 2013.
COMPREHENSIVE Access Tutorial 11 Using and Writing Visual Basic for Applications Code.
Equations Inequalities = > 3 5(8) - 4 Numerical
Solving 2 step equations. Two step equations have addition or subtraction and multiply or divide 3x + 1 = 10 3x + 1 = 10 4y + 2 = 10 4y + 2 = 10 2b +
Macros in Excel Using VBA Time Required – 5 hours.
Chapter 10 Using Macros, Controls and Visual Basic for Applications (VBA) with Excel Microsoft Excel 2013.
ME 142 Engineering Computation I Condition Statements.
COMPREHENSIVE Excel Tutorial 12 Expanding Excel with Visual Basic for Applications.
Solve Equations with Exponents
Excel Tutorial 8 Developing an Excel Application
8 – Properties of Exponents No Calculator
ME 142 Engineering Computation I
Microsoft Office Illustrated
أ.إسراء الطريقي أ. هاله الشملان , 102 تقن , المعمل الخامس
ME 142 Engineering Computation I
Accuracy and Precision
Lesson 1 - Automating Tasks
Microsoft Office Excel 2003
Bell Ringer Throw Back Thursday
Bell Ringer Throw Back Thursday
Evaluating Expressions
Presentation transcript:

ME 142 Engineering Computation I Variables, Equations & Functions Introduction to Basic Programming Language

Key Concepts Defining Variables & Equations Launching VBA Programming Basics

Defining Variables & Equations

What is a Variable?

Variables  A named element that stores information or data  Variable examples: A=2.45 X=Y+Z I=I+1 B=“Hello Class”

Basic Math Operators  Same as used in Excel spreadsheets +add -subtract *multiply /divide ( )parenthesis ^exponent

Launching VBA

Enabling the Developer’s Ribbon

Launching VBA  Enable Developer’s Tab Once enabled, should remain enabled  Select Visual Basic from Developer’s Tab

Launching VBA  Right click on Project…  Select Insert/Module

Launching VBA Congratulations, you’re ready to begin programming!

Programming Basics

Example VBA Function Function demo(a,b)' (Input) 'An example program to add two numbers 'Add 2 numbers (Process) c = a + b 'Return results (Output) demo= c End Function

Executing a VBA Function

Saving a VBA Program  How do you save a program?  What is a macro-enabled workbook?  Where is the program saved?  How do I retrieve a program?  What is this error about macros that I get when I try to open my saved excel file?

Excel/VBA Tip  The VBA Function worksheetfunction may be used to call Excel function: P=worksheetfunction.pi D=worksheetfunction.degrees(x)

Example Problem  Develop a VBA function to calculate the volume of a sphere, given its radius, r. Volume = 4 * π * r 3 / 3  Use your new VBA function within Excel to find the total volume of the metal used to make the cannonball pyramid below, given d=4.5”

Review Questions

I-Clicker Question Variables Which of the following variable assignments are valid: A.x = y + z B.y + z = x C.Both are valid variable assignments D.Neither are valid variable assignments

I-Clicker Question Launching VBA The shortcut to launch the VBA editor is: A.Alt + V + B B.F7 C.Alt + F11 D.None of the above E.There is no shortcut

I-Clicker Question Running VBA In the first line of a function, the parenthesis immediately after the function name may be omitted: A.True B.False

Homework Help ‘n Hints