ChE 117 Motivation Lots of Tools Can’t always use “Canned Programs”

Slides:



Advertisements
Similar presentations
Sep-05 Slide:1 VBA in Excel Walter Milner. Sep-05 Slide:2 VBA in Excel Introduction VBA = Visual Basic for Applications Enables end-user programming In.
Advertisements

CE 311 K Introduction to Computer Methods VB Controls and Events Daene C. McKinney.
Excel and Visual Basic. Outline Data exchange between Excel and Visual Basic. Programming VB in Excel.
Visual Basic for Applications. What it does Extends the features and built in functions of Excel – Create and run VB procedures – Some may be easy to.
XP New Perspectives on Microsoft Excel 2003, Second Edition- Tutorial 8 1 Microsoft Office Excel 2003 Tutorial 8 – Developing an Excel Application.
Objectives Understand the software development lifecycle Perform calculations Use decision structures Perform data validation Use logical operators Use.
Tutorial 12: Enhancing Excel with Visual Basic for Applications
Customisation The GUI in most GIS applications is sufficient for most needs. However, situations arise where you want either to: –Modify the interface,
Chapter 1 - An Introduction to Computers and Problem Solving
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
CS105 INTRODUCTION TO COMPUTER CONCEPTS INTRO TO PROGRAMMING Instructor: Cuong (Charlie) Pham.
How to get started with Excel VBA. We need to enable programming in Excel  the “Developer menu”
PROJECT OVERVIEW PINGER EXECUTIVE PLOTS AKBAR MEHDI.
Chapter 2- Visual Basic Schneider
Excel and VBA Creating an Excel Application
Computer Concepts 5th Edition Parsons/Oja Page 546 CHAPTER 11 Software Engineering Section A PARSONS/OJA Computer Programming.
Programming Excel Macros, Visual Basic, and Solving Your Problem.
Program Flow Charting How to tackle the beginning stage a program design.
VBA Programming Part One. Our Dartmouth Legacy 10 INPUT "What is your name: "; U$ 20 PRINT "Hello "; U$ 25 REM 30 INPUT "How many stars do you want: ";
Using the Visual Basic Editor Visual Basic for Applications 1.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
Adding Automated Functionality to Office Applications.
VBA & Excel Barry L. Nelson IEMS 465 Fall Quarter 2003.
Exploring Microsoft Excel 2002 Chapter 8 Chapter 8 Automating Repetitive Tasks: Macros and Visual Basic for Applications By Robert T. Grauer Maryann Barber.
University of Delaware Information Technology User Services.
Business Programming I Fall – 2000 By Jim Payne Lecture 03Jim Payne - University of Tulsa2 A New Programming Language In our previous sessions, we have.
1 Programming Concepts Module Code : CMV6107 Class Contact Hours: 45 hours (Lecture 15 hours) (Laboratory/Tutorial 30 hours) Module Value: 1 Textbook:
Programming Languages CPS120: Introduction to Computer Science Lecture 5.
Unit 20: Event Driven Programming
CS 0004 –Lecture 1 Wednesday, Jan 5 th, 2011 Roxana Gheorghiu.
VBA for Excel. What is a spreadsheet? u An Excel spreadsheet is a set of worksheets  Each worksheets is made up of rows and columns of cells  Rows are.
COMPUTER PROGRAMMING Source: Computing Concepts (the I-series) by Haag, Cummings, and Rhea, McGraw-Hill/Irwin, 2002.
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 on VBA Lab 05 ins.Tahani Al_dweesh. Lab Objectives Introduction Calculation with VBA Storing and Retrieving Variables in a Worksheet Using.
1 Visual Basic for Applications (VBA) for Excel Prof. Yitzchak Rosenthal.
Chapter 11: Introduction to the Visual Basic Environment Spreadsheet-Based Decision Support Systems Prof. Name Position (123) University.
Chapter 11 An Introduction to Visual Basic 2008 Why Windows and Why Visual Basic How You Develop a Visual Basic Application The Different Versions of Visual.
Visual BASIC 1 Introduction
Outline Software and Programming Program Structure Tools for Designing Software Programming Languages Introduction to Visual Basic (VBA)
1 Course Title: Visual Basic Programming Topic: Introduction to programming Languages (Visual basic 6.0) Lecturer: Mahamud Ahmed Jimale, BsIT, MsCs, CCNA,
Chapter Two Creating a First Project in Visual Basic.
Chapter 9 Macros And Visual Basic For Applications.
Computing System Fundamentals 3.1 Language Translators.
Visual Basic  Is the language for programming in Word, Access,& Excel  Is the “Environment” in which the programming is done (called the Integrated Development.
Chapter 11: Introduction to VBA Spreadsheet-Based Decision Support Systems Prof. Name Position (123) University Name.
1 Programming Tools Flowcharts Pseudocode Hierarchy Chart Direction of Numbered NYC Streets Algorithm Class Average Algorithm.
Macro’s Within excel. Most functionality can be driven from VBA VBA is the programming language that runs inside of excel. It uses visual basic as the.
Programming and Languages Dept. of Computer and Information Science IUPUI.
Chapter 2- Visual Basic Schneider1 Chapter 2 Problem Solving.
Chapter 15: Sub Procedures and Function Procedures Spreadsheet-Based Decision Support Systems Prof. Name Position (123) University.
PROGRAMMING FUNDAMENTALS INTRODUCTION TO PROGRAMMING. Computer Programming Concepts. Flowchart. Structured Programming Design. Implementation Documentation.
Financial Information Management VB, VBA, VS, VSTO & VBE: Putting it all together Source: Excel VBA Programming by John Walkenbach.
© Stefano Grazioli - Ask for permission for using/quoting: Source: Excel VBA Programming by John Walkenbach.
CSE 110: Programming Language I Matin Saad Abdullah UB 404.
Chapter 2- Visual Basic Schneider1 Programming Languages: Machine Language Assembly Language High level Language.
COMPREHENSIVE Excel Tutorial 12 Expanding Excel with Visual Basic for Applications.
VBA Excel Macro 1.Create a Macro: To create a macro in Excel VBA, Create a Macro: To create a macro in Excel VBA,Create a Macro: To create a macro.
The Advantage Series ©2005 The McGraw-Hill Companies, Inc. All rights reserved Chapter 12 Introducing Visual Basic for Applications Microsoft Office Excel.
Programming Languages
Chapter 2- Visual Basic Schneider
Unit 20: Event Driven Programming
Excel VBA Day 3 of 3 Tom Vorves.
Learning Excel Session 9 and 10 Dr. Chaitali Basu Mukherji.
Exploring Microsoft Excel
أ.إسراء الطريقي أ. هاله الشملان , 102 تقن , المعمل الخامس
IS-171 Computing With Spreadsheets
Chapter 2- Visual Basic Schneider
Microsoft Office Excel 2003
CS105 Introduction to Computer Concepts Intro to programming
Presentation transcript:

ChE 117 Motivation Lots of Tools Can’t always use “Canned Programs” Excel • Mathematica MathCAD • Calculators Matlab • Polymath Can’t always use “Canned Programs” i.e. binary phase equilibria Data manipulation Process control and data acquisition Excel macro language (VBA) Web pages

Programming language: Visual Basic Interface with Excel (VBA) Similar to Fortran, C, C++, etc PC-based DAQ (data acquisition) and control High-level language (vs assembly) What is: Visual Basic .NET Computer interface List of instructions Contains Interpreter VB  machine language “on the fly”

Example: convert °F to °C or °C to °F What is a Program? Road map Set of instructions Good for repetition Input  Manipulate Output Example: convert °F to °C or °C to °F GUI ID Parts!

Example Program (manipulation) Average 3 numbers (10, 12, 15) Sub Avg() n1 = 10 n2 = 12 n3 = 15 avge = (n1 + n2 + n3) / 3 MsgBox avge End Sub

Decisions (“If” statements) Sub test2() label = "F" TF = 212 If label = "F" Then TC = (TF + 460) / 1.8 - 273 MsgBox TC End If End Sub “If – Then – Else - Endif Sub test3() label = "C" Tin = 100 If label = "F" Then Tout = (Tin + 460) / 1.8 - 273 Else Tout = (Tin + 273) * 1.8 - 460 End If MsgBox Tout End Sub

Loops (“If” statements) Add numbers 1 - 10 Sub looper1() sum = 1 n = 1 10 If n < 10 Then n = n + 1 sum = sum + n GoTo 10 End If MsgBox sum End Sub Loops (For – Next) Sub looper2() sum = 0 For i = 1 To 10 sum = sum + i Next i MsgBox sum End Sub

MS Excel & Visual Basic (VBA ~ VB.6) Excel Environment Worksheets Chart Sheets Workbook Modules sub & function procedures User Forms and objects (VBA code) VB Editor / Modules

Example Program (manipulation) Set up macro to calculate an average… use example as template. Run the macro Set up Form Button to run macro

Problem Solving Exercise (in groups) Set up macro to convert 100 kg to lbs or lbs to kg Display result in msgbox Run the macro Set up Form Button to run macro