LAB3 - • Recap – VBA Functions • Introduction to Sub...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: • Recap – VBA Functions • Introduction to Sub programs • I/O operations – Cells, Message box & input box • Debugging Tools • Cell formatting • Used to program complex calculations and/or simulations • Syntax: Sub sub_name(Arguments) 1. Define/Declare Variables 2. Input data 3. Calculations to be performed 4. Output (or return) data End Sub • Sub programs can return multiple outputs • Are not accessed from the cells (unlike functions) • Input (from cells to VBA): ip_variable = Sheet#.Cell(R, C).Value • Output (from VBA to cells): Sheet#.Cell(R, C).Value = op_variable • Other I/O methods: 1. Message Box: Msgbox(“Message to user”) 2. Input Box: ip_variable = InputBox(“Message to user) • Calculations step and output step can be combined into one single step. But this is not recommended • Debugging refers to catching errors in the program and sorting them out • Debugging tools are very useful and quicken debugging Run just 1 line (step) Skip the current step Go back 1 step Create break point at the current step Run Pause Stop •...
View Full Document

This note was uploaded on 11/28/2011 for the course ENGR 1412 taught by Professor Staff during the Fall '08 term at Oklahoma State.

Page1 / 7

LAB3 - • Recap – VBA Functions • Introduction to Sub...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online