Basics 2. Write a macro that … … uses a popup message box to say Hello. (msgbox ”Hello”) … writes the contents of the active cell in a message box. (you.

Slides:



Advertisements
Similar presentations
Lesson 3 Working with Formulas.
Advertisements

Microsoft Excel Khan Mohammad Mahmud Hasan
P1PMF Split1 QBASIC. P1PMF Split2QBasic Command Prompt Will launch the emulator DOS operating system? Press Alt + Enter to display the widescreen.
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.
Microsoft Visual Basic 2005: Reloaded Second Edition Chapter 4 Making Decisions in a Program.
Deleting worksheets from the workbook There are times when we may want to delete a worksheet from the workbook. Sometimes I add a worksheet as a temporary.
Chapter 6 Financial Forecast. Agenda Developing a financial forecast model Advanced formatting Using the scenario manager to facilitate decision-making.
How to get started with Excel VBA. We need to enable programming in Excel  the “Developer menu”
Chapter 2 Review Questions
Comparing Integers Lesson
IAT 800 Foundations of Computational Art and Design Lecture 2.
General Computer Science for Engineers CISC 106 Lecture 08 Dr. John Cavazos Computer and Information Sciences 2/27/2009.
1 Committed to Shaping the Next Generation of IT Experts. Chapter 4: Spreadsheets in Decision Making: What If? Robert Grauer and Maryann Barber Exploring.
Programming with MATLAB. Relational Operators The arithmetic operators has precedence over relational operators.
Android Apps: Building Blocks Module 6, Intro to I.T., Fall 2011 Sam Scott.
Exploring Microsoft Excel 2002 Chapter 8 Chapter 8 Automating Repetitive Tasks: Macros and Visual Basic for Applications By Robert T. Grauer Maryann Barber.
Spreadsheets in Finance and Forecasting Presentation 11 Visual Basic.
Finish Decryption 25 minutes. Introduction to VBA Day 4.
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.
12. Visual Basic If Statements and Do Loops. Open 12b-datastart.xlsm.
Week 8.  Recap  User Forms  Input Validation Message Boxes Input Boxes  Conversion Functions.
Week 3.  Assessed Exercise 1  Working with ranges.
Python Programming Using Variables and input. Objectives We’re learning to make use of if statements to enable code to ask questions. Outcomes Build an.
VBA Lab 2 I ns.Samia Al-blwi. Visual Basic Grammar Object: Visual Basic is an object-oriented language. This means that all the items in Excel are thought.
1 Κατανεμημένες Διαδικτυακές Εφαρμογές Πολυμέσων Γιάννης Πετράκης.
Lesson 5: Working with Formulas and Functions Logical and 3D Formulas.
Shannon K. Basher, MLS Houston Academy of Medicine – Texas Medical Center Library.
Week 4.  Recap – Ranges  For Each Loops  Ranges Referencing Range Objects  Set (keyword)
Scratch Programming Lesson 4 Question asking and answering.
Teacher Notes You do not have to use all examples. If you feel the kids are getting it well, skip some of the examples and you can do the homework problems.
Lab 4 Range Review, Control Logic and Loops ► Range Review ► Control Logic and Loops ► Exercise.
BACS 287 Programming Logic 2. BACS 287 Sequence Construct The sequence construct is the default execution mode for the CPU. The instructions are executed.
Jeopardy Template By Jeanne Whitmore & Brooke Blair.
Algorithms Writing instructions in the order they should execute.
Counter Probabilities Teacher's Notes Topic: Probability
Computer-made Decisions Chapter 3 & 4. Overview u Variable Scope u Conditionals  Relational Operators  AND, OR, NOT u If Statements u MsgBox function.
Solve the following equations for x: 1) 2) 3) 4) 5) 6)
< < < > < > <
LCC 6310 Computation as an Expressive Medium Lecture 2.
VBScript Conditional Statements. Conditional Statements Very often when you write code, you want to perform different actions for different decisions.
MIS 3200 – Unit 3.2 Page_Load method AutoPostBack property of controls IsPostBack method of the Page object Understanding web page life cycle.
 You need a new workbook. How do you create one? (Pick one answer.) a. In the Cells group, click Insert, and then click Insert Sheet.
31/01/ Selection If selection construct.
Introduction to Macros in Excel Franco Musso. ActiveCell.Offset.
Solve 7n – 2 = 5n + 6. Example 1: Solving Equations with Variables on Both Sides To collect the variable terms on one side, subtract 5n from both sides.
Key Concepts 2 Simple VB Procedures Simple VB Applications - take with Other Examples - time permitting.
USING CONDITIONAL CODE AMIR KHANZADA. Conditional Statement  Conditional statements are the set of commands used to perform different actions based on.
File Handle and conditional Lecture 2. File Handling The Files associated with Perl are often text files: e.g. text1.txt Files need to be “opened for.
CONDITIONAL FORMATTING AND CUSTOM NUMBER FORMATS LEC 5 1.
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.
Macros in Excel Using VBA Time Required – 5 hours.
Teacher’s please delete personal pictures in slides 6, 7, and 8.
Part 1 Learning Objectives To understand that variables are a temporary named location to store data and that programmers work with different data types.
Computer Information Technology Section 6-17
Move the decimal point.
Learning Excel Session 9 and 10 Dr. Chaitali Basu Mukherji.
Exploring Microsoft Excel
KS2 Questions types KS2 need exposure to..
Conditional Logic Presentation Name Course Name
Programming In Lesson 4.
Activate a range and manipulating activated range
IAT 800 Foundations of Computational Art and Design
Inequalities and their Graphs
6.3 Using Elimination to Solve Systems
Solving Inequalities.
13.5 Inequalities Math 1.
More on If statements (Calculate, Calculate1, Calculate2)
LCC 6310 Computation as an Expressive Medium
Presentation transcript:

Basics 2

Write a macro that … … uses a popup message box to say Hello. (msgbox ”Hello”) … writes the contents of the active cell in a message box. (you need: msgbox …; activecell.value) … fills the selection with your name. (selection.value…) … fills the selection with the contents of cell A1! (range(”A1”).value)

Write a macro that … … displays the active workbooks name in a message box. … puts the workbooks name in the active cell. … copies contents of the active cell to the one under it. … displays the active cells value multiplied by 100 in a message box. … multiplies the active cell by 100 (in place).

Write a macro that … … multiplies the active cell by the cell on the left, and puts the results into the cell on the right. Same as above, but this time, display the results in a message box. … gives a warning in a message box about deleting cell contents, then deletes the contents of the active cell. … deletes contents from the selection, then changes the background colours to red.

Branching If statement Then True part; Commands if statement is true Else False part; Commands in case statement is false End if If statement1 Then True part1; ElseIf stmnt2 Then True part2; ElseIf stmnt3 Then True part3; Else False part; End if

Exercises for IF conditions If active cell is empty, change its colour to red. If the number in the active cell is >10, clear it. If active cell is < 10, add 1, else clear it. If active cell is negative, change its colour to red, else make it green.

Exercises for IF conditions Write a macro that tells us in a message box if the active cell is greater then the one to the right, or not. Write a macro that tells us in a message box if the active cell is greater than, less than or equal to the one to the right.