1 / 9

ME 142 Engineering Computation I

ME 142 Engineering Computation I. Variables, Equations & Functions Introduction to Basic Programming Language. 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

geraldo
Download Presentation

ME 142 Engineering Computation I

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


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

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

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

  4. Enabling the Developer’s Ribbon

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

  6. Launching VBA • Right click on Project… • Select Insert/Module

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

  8. 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

  9. Executing a VBA Function

More Related