Download the files from you will use these files to finish the following exercises.

Similar documents
BASIC EXCEL SYLLABUS Section 1: Getting Started Section 2: Working with Worksheet Section 3: Administration Section 4: Data Handling & Manipulation

Workbooks (File) and Worksheet Handling

The Microsoft Excel Course is divided into 4 levels

Customizing the Excel 2013 program window. Getting started with Excel 2013

6/14/2010. VBA program units: Subroutines and Functions. Functions: Examples: Examples:

3. (1.0 point) To quickly switch to the Visual Basic Editor, press on your keyboard. a. Esc + F1 b. Ctrl + F7 c. Alt + F11 d.

Advanced Excel Charts : Tables : Pivots

TABLE OF CONTENTS. i Excel 2016 Advanced. 1 INTRODUCTION Method Software and other settings Exercise files 2

Excel Tip: How to create a pivot table that updates automatically

Instructions for creating and modifying queries will be available in the future.

Ms Excel Vba Continue Loop Through Columns Range

Unit 9 Spreadsheet development. Create a user form

CSE 123 Introduction to Computing

How to Reduce Large Excel File Size (Ultimate Guide)

Consolidate and Summarizing Data from Multiple Worksheets

Microsoft Excel 2007 Macros and VBA

Excel 2016: Introduction to VBA

MS Excel VBA Class Goals

Course Title: Intermediate Excel (Version :2013/2016) Duration : 2 days

DATA 301 Introduction to Data Analytics Microsoft Excel VBA. Dr. Ramon Lawrence University of British Columbia Okanagan

Getting the Most from your Microsoft Excel

MODULE VI: MORE FUNCTIONS

Course Content Excel Advanced Duration: 1 Day Unit Standard

download instant at

Microsoft Excel. for Finance Majors. Microsoft Excel for Finance Majors

Microsoft Excel Expert 2010, Objective Domain

Ms Excel Vba Continue Loop Through Worksheets By Name

The For Next and For Each Loops Explained for VBA & Excel

Microsoft. Course EXC13E: Microsoft Excel 2013 Expert. Technology : Microsoft Office 2013 Delivery Method : Instructor-led (classroom)

<excelunusual.com> Easy Zoom -Chart axis Scaling Using VBA - by George Lungu. < 1. Introduction: Chart naming: by George Lungu

Nomas Training. Course Outlines

Ms Excel Vba Continue Loop Through Range Of

Ms Excel Dashboards & VBA

Microsoft Power Tools for Data Analysis #13 Power Pivot Into #1: Relationships Rather Than VLOOKUP Notes from Video:

Corporate essentials

Excel 2010 Formulas Not Working In Dragging >>>CLICK HERE<<<

Excel 2016 Advanced. Course Objectives

CSE 123 Introduction to Computing

Advance Excel Performing calculations on data 1. Naming groups of data 2. Creating formulas to calculate values

COURSE CONTENT Excel with VBA Training

Excel. More Skills 11 Insert and Edit Comments. To complete this workbook, you will need the following file: You will save your workbook as: CHAPTER 2

Contents. Some Basics Simple VBA Procedure (Macro) To Execute The Procedure Recording A Macro About Macro Recorder VBA Objects Reference

Creating Automated Dashboard Excel 2013 Contents

Office 2016 Excel Basics 21 Video/Class Project #33 Excel Basics 21: Relationships Rather than VLOOKUP for PivotTable Reports (Excel 2016 Data Model)

MICROSOFT EXCEL BIS 202. Lesson 1. Prepared By: Amna Alshurooqi Hajar Alshurooqi

2013 ADVANCED MANUAL

Advanced Excel Skills

Excel Tools Features... 1 Comments... 2 List Comments Formatting... 3 Center Across... 3 Hide Blank Rows... 3 Lists... 3 Sheet Links...

ADVANCED EXCEL Course Modules for Advance Excel Training Online (MS Excel 2013 Course):

Half day Excel workshops suggested content

Starting Excel application

Issue & Action Register. Issue & Action Register Guide. Strategic Capital, Infrastructure and Projects

Patricia Andrada Quick Guide Excel 2010 Data Management-July 2011 Page 1

Microsoft Excel 2016 Level 1

Excel Course Outline

The Basics of Excel Part III. Monday, April 17 th 2017 D-Lab University of California, Berkeley

Visual basic tutorial problems, developed by Dr. Clement,

Agenda. First Example 24/09/2009 INTRODUCTION TO VBA PROGRAMMING. First Example. The world s simplest calculator...

How to Create a For Next Loop in Excel VBA!

Error Vba Code For Vlookup Function In Excel 2010

EXCEL WORKSHOP III INTRODUCTION TO MACROS AND VBA PROGRAMMING

- EXCEL (BASIC & INTERMEDIATE) - ADVANCED EXCEL - VBA MACROS ,

Quick Guide for Excel 2015 Data Management November 2015 Training:

Microsoft Excel 2010 Level 1

VBA Collections A Group of Similar Objects that Share Common Properties, Methods and

Computer, Software and Technology Skills


Read More: Index Function Excel [Examples, Make Dynamic Range, INDEX MATCH]

PHLI Instruction (734) Introduction. Lists.


Themes & Templates Applying a theme Customizing a theme Creatingfilefromtemplate Creating yourowncustomize Template Using templates Editing templates

Manual Data Validation Excel 2010 List From Another Workbook

VBA MACROS ,

DOWNLOAD PDF EXCEL MACRO TO PRINT WORKSHEET TO

Public Function randomdouble(lowerbound As Double, upperbound As Double) As Double On Error Resume Next

Saving a Workbook That Contains Macros

Microsoft Excel Office 2016/2013/2010/2007 Tips and Tricks

KEYWORDS DDE GETOBJECT PATHNAME CLASS VB EDITOR WITHEVENTS HMI 1.0 TYPE LIBRARY HMI.TAG

Excel Expert 2016: Interpreting Data for Insights Exam

Excel Programming with VBA (Macro Programming) 24 hours Getting Started

More Skills 12 Create Web Queries and Clear Hyperlinks

To complete this workbook, you will need the following file:

COURSE OUTLINE MS Excel 2013 Level 3 Last Updated: 5 August 2016

Commonwealth Computer Training Featured Workshop: WORD 2010 DOCUMENT MANAGEMENT

Microsoft Office Excel 2013

Extracting the last word of a string Extracting all but the first word of a string Extracting first names, middle names, and last names Counting the

For comprehensive certification training, students should complete Excel 2007: Basic, Intermediate, and Advanced. Course Introduction

Excel Macro Runtime Error Code 1004 Saveas Of Object _workbook Failed

Chart For Dummies Excel 2010 Title Link To Cell Value Into

Microsoft Office Excel 2010: Intermediate. Course Overview. Course Length: 1 Day. Course Overview

Microsoft Excel 2010 Level 1

Preface SECTION 1 LEARN AND UNDERSTAND 1. Chapter 1. Evolution of ICT and digitalization in the information society 3

Microfocus VBA Add-On for Rumba+ Desktop. Quick Start Guide

Microsoft Excel 2013 Table of content

6. This is too selective. Amend the filter criteria to also include anyone born before How many staff are now selected?

Ms excel. The Microsoft Office Button. The Quick Access Toolbar

CERTIFICATE IN BIG DATA TECHNIQUES ON SMALL DATA FORMAT UTILIZING MICROSOFT EXCEL

VBA Excel 2013/2016. VBA Visual Basic for Applications. Learner Guide

Spreadsheet Structure

This chapter is intended to take you through the basic steps of using the Visual Basic

Transcription:

Exercise 6 Download the files from http://www.peter-lo.com/teaching/x4-xt-cdp-0071-a/source6.zip, you will use these files to finish the following exercises. 1. This exercise will guide you how to create a simple game using VBA, please ensure your security level set to Medium or Low before start this exercise. A) Open a new workbook, enter I have a number between 1-9, please guess in cell A1. Then create a Textbox from the Active X Controls in the Developer tab. B) Create a Command Button from the Active X Controls in the Developer tab X4-XT-CDP-0071-A @ Peter Lo 2016 1

C) Right click the command button, and select Properties. D) Change the Caption for the command button to New Game. X4-XT-CDP-0071-A @ Peter Lo 2016 2

E) Double click the command button New Game to open the Visual Basic Editor, and then enter the following code. Private Sub CommandButton1_Click() ' Initialize the random-number generator. Randomize End Sub ' Generate random value between 1 and 9. RandomNumber = Int((9 * Rnd()) + 1) F) Select File Close and Return to Microsoft Excel in the Visual Basic Editor. G) Create another Command Button from the Active X Controls in the Developer tab X4-XT-CDP-0071-A @ Peter Lo 2016 3

H) Right click the Button, and select Properties. I) Change the Caption to Guess. X4-XT-CDP-0071-A @ Peter Lo 2016 4

J) Double click the command button Guess to open the Visual Basic Editor, and then enter the following code. Private Sub CommandButton2_Click() If TextBox1.Text > RandomNumber Then MsgBox ("Too Big!") ElseIf TextBox1.Text < RandomNumber Then MsgBox ("Too Small!") ElseIf TextBox1.Text = RandomNumber Then MsgBox ("Correct!") End If End Sub K) Add the variable declaration statement on the top of the program. Dim RandomNumber As Integer Private Sub CommandButton1_Click() If TextBox1.Text > RandomNumber Then MsgBox ("Too Big!") ElseIf TextBox1.Text < RandomNumber Then MsgBox ("Too Small!") ElseIf TextBox1.Text = RandomNumber Then MsgBox ("Correct!") End If End Sub X4-XT-CDP-0071-A @ Peter Lo 2016 5

Private Sub CommandButton2_Click() ' Initialize the random-number generator. Randomize End Sub ' Generate random value between 1 and 9. RandomNumber = Int((9 * Rnd()) + 1) L) Select File Close and Return to Microsoft Excel in the Visual Basic Editor. X4-XT-CDP-0071-A @ Peter Lo 2016 6

M) Save the file as Guess Number.xlsm and close it. Pease note that you must select Excel Macro-Enables Workbook (*.xlsm), or you will lose all Macro and VBA content N) Open the file Guess Number.xlsm and press the [New Game] button to start a new game. Now you can input your answer and press [Guess] to check your luck. X4-XT-CDP-0071-A @ Peter Lo 2016 7

2. This exercise will test your knowledge learnt in this Advanced Excel course. You are required apply all your skill (such as formula, conditional formatting, data validation, pivot table and charting) to complete this exercise. A) Open the Excel file Question 6-2.xlsx, and apply the following rules: i. Calculate the Duration for each task: End Date Start Date. ii. Create a drop down list for user to select the Priority: High, Medium, and Low. iii. Create a drop down list for the Responsible based on the worksheet Staff. iv. By using VLOOKUP, obtain the Department for each Responsible v. Create a drop down list for the user to select the Status: Open, In Progress, and Closed. B) Fill the data in the column Priority, Responsible and Status, the content in the column Duration and Department should be auto determined. C) By using the conditional formatting, apply the following rules to the worksheet i. Set the row to Green color if the Status is Closed. ii. Set the row to Red color if the Status is not Closed and End Date is overdue. X4-XT-CDP-0071-A @ Peter Lo 2016 8

D) Create a Gantt chart for the project schedule as follow: E) Create a Pivot Table and Pivot Chart for the overall summary X4-XT-CDP-0071-A @ Peter Lo 2016 9