Working with Charts ISYS 562. Chart Locations As an embedded object on a worksheet: –Worksheet ChartObjects –ChartObject: A container for a chart »Chart.

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

By Angel Aguila. Apply the range name Category to cells A1:C1, as you normally would. When lists are subject to updates, use a dynamic range instead.
Excel and Visual Basic. Outline Data exchange between Excel and Visual Basic. Programming VB in Excel.
Microsoft Office XP Microsoft Excel
情報基礎 A Lecture 10 Takeshi Tokuyama Tohoku University Graduate School of Information Sciences System Information Sciences Design and Analysis of Information.
Object Oriented Programming A programming concept which views programs as objects with properties and ways to manipulate the object and the properties.
Modeling using VBA. Covered materials -Userforms -Controls -Module -Procedures & Functions -Variables -Scope.
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.
Week 10.  Protecting Code  Protecting Worksheets  Error Handling  Charts.
Different type of input Use of Basic language with Excel Silvia Patacchini.
VBA for MS Excel Hamze Msheik. Open the Visual Basic Editor in Excel 2007 Click on the Microsoft Office button in the top left of the Excel window and.
Creating Dashboard with Excel ISYS 650. Pivot Table Demo Creating a query from Northwind data warehouse that shows: –OrderYear, Quarter, CategoryID, Sales.
Chapter 6  Chart Terminology  Chart Wizard  Moving Resizing Charts  Editing Charts  Formatting Charts.
XP New Perspectives on Microsoft Excel 2002 Tutorial 1 1 Microsoft Excel.
Charts and Macros Pretty Pictures. Charts Graphical display of information Often referred to as “Visualization” Allows a more innate grasp of numeric.
Miscellaneous Topics ISYS562. Scenario Scenarios are part of a suite of commands sometimes called what-if-analysis tools. A scenario is a set of values.
Overview of Excel Object Model ISYS 562. Excel’s Database Tools Lookup and Database functions: –VLookUp, D functions Data –Sort –Filter –Subtotals –Pivot.
The Repetition Structure Lecture 11 08/07/06 Dan Rao.
Comet - an Erlang-to-COM Port n Comet is a port and a gen_server module that enables Erlang programs to deploy COM components n Comet is under development,
Chart. Creat a Chart Steps to create a chart –1. Select the data range –2. Insert/Charts/Type –3. Use the Chart tool to add or modify chart elements:
VBA Programming Session #2. Things to Review  Variables  Procedures: Subs & Functions  If…Then  For…Next.
Copyright 2003, Paradigm Publishing Inc. CHAPTER 7 BACKNEXTEND 7-1 LINKS TO OBJECTIVES Create a Chart Create in a Separate Worksheet Create in a Separate.
VBA & Excel Barry L. Nelson IEMS 465 Fall Quarter 2003.
Professor Michael J. Losacco CIS 1150 – Introduction to Computer Information Systems Spreadsheets Chapter 3.
Chart Components 4.02 Understand charts and graphs used in business.
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.
情報基礎 A Lecture 15 Takeshi Tokuyama Tohoku University Graduate School of Information Sciences System Information Sciences Design and Analysis of Information.
Creating Macros Using VBA. Assigning a Macro to a Button Display the Forms toolbar. Click the Button icon. Click and drag the mouse pointer to specify.
STATISTICS Microsoft Excel “Frequency Distribution”
OV Copyright © 2011 Element K Content LLC. All rights reserved.  Create a Macro with the Macro Recorder  Edit a Macro  Debug a Macro  Customize.
Organizing Data A graph is a pictorial representation of information recorded in a data table. It is used to show a relationship between two or more factors.
OV Copyright © 2011 Element K Content LLC. All rights reserved.  Insert Text  Format Text  Sort Data  Duplicate Data  Generate a Report Formatting.
CTS130 Spreadsheet Lesson 9 - Building Charts. What is a Chart? A chart is a visual display of information in a worksheet. Charts can help you make comparisons,
Lab 4 Range Review, Control Logic and Loops ► Range Review ► Control Logic and Loops ► Exercise.
CREATING CHARTS By: Dr. Ennis - Cole OBJECTIVES b Identify the elements of an Excel chart b Identify the type of chart represents your data most effectively.
Chapter 5 Recording Macros. How to Record a Macro Use Tools/Macro/Record New Marco Give the following information: macro name; provide a description of.
A lesson approach © 2011 The McGraw-Hill Companies, Inc. All rights reserved. a lesson approach Microsoft® Excel 2010 © 2011 The McGraw-Hill Companies,
EXCEL CHARTS. CHARTS Charts provide a way of presenting and comparing data in graphical format. Embedded charts or chart sheets Embedded charts are objects.
Office 2003 Advanced Concepts and Techniques M i c r o s o f t Access Project 6 Switchboards, PivotTables, and PivotCharts.
Application Software Advanced Spreadsheets "Number crunching"
Visual Basic  Is the language for programming in Word, Access,& Excel  Is the “Environment” in which the programming is done (called the Integrated Development.
Repetition Structures
Lab 2 Introduction to VBA (II) ► Lab 1 revisited - Sub & Function procedures - Data types and variable declaration ► Recording.
Introduction to Excel VBA UNC Charlotte CPE/PDH Series December 17, 2009.
Via Visual Basic For Applications. Today Context Demonstration The Basics Prereqs: Have attempted to run/record/tweak a macro NEW knowledge Activesheet,
Microsoft® Excel Use the Chart Tools Design tab. 1 Use the Chart Tools Layout and Format tabs. 2 Create chart sheets and chart objects. 3 Edit.
Working with Charts and Graphics CREATING CHARTS Lesson 6 - Microsoft Excel 2010.
Creating an Impact with Charts. 2 Managing Workbooks  New workbooks open with three worksheets  Can hold up to the available amount of computer memory.
LESSON 6 Working with Charts. Each chart type has its own collection of sub-types that provide various alternate formats for the selected chart type.
Visual Basic Objects / Properties / Methods PropertyAdjective ObjectNoun Part of the application Attribute MethodVerb Action to do something.
CHART COMPONENTS Lesson 6 – Working With Charts and Graphics, continued.
ADO.NET Objects Data Adapters Dr. Ron Eaglin. Agenda Builds on Information in Part I Should have working knowledge of creating a database connection Continuation.
Working with charts Excel charts An Excel chart is simply packed with objects, each of which has its own properties and methods. Because of this,
Financial Information Management VB, VBA, VS, VSTO & VBE: Putting it all together Source: Excel VBA Programming by John Walkenbach.
CHART COMPONENTS Lesson 6 – Working With Charts and Graphics, continued.
VBA Programming for Excel Review Excel Objects Excel Methods Identifying Specific Cells Review Functions for Excel Custom Menus.
Chart Components 3.03 Identify charts and graphs used in business.
INTRODUCTTION TO CHARTS AND GRAPHS. Data Series I S IT A CHART OR A GRAPH ? A graph is a feature of a chart used to plot data. The chart is the total.
Chapter 7 Creating Templates, Importing Data, and Working with SmartArt, Images, and Screen Shots Microsoft Excel 2013.
Lesson 1 Notes.  A chart is a representation of worksheet data. A chart can enhance and simplify the of numerical data in a worksheet because the between.
CHART COMPONENTS Excel. COMPONENTS OF CHARTS AND GRAPHS ▪ The y-axis is the left vertical side of the graph. It contains the numerical data. ▪ The x-axis.
New Perspectives on Microsoft
Even More VBA IE 469 Spring 2017.
Excel VBA Day 3 of 3 Tom Vorves.
Visual Basic for Applications in Microsoft Excel (1)
البرمجة بلغة فيجول بيسك ستوديو
Building Worksheet Charts
Comet - an Erlang-to-COM Port
Know Your Charts Unit 3 Excel.
VBA Programming for Excel
Presentation transcript:

Working with Charts ISYS 562

Chart Locations As an embedded object on a worksheet: –Worksheet ChartObjects –ChartObject: A container for a chart »Chart » Chart properties and methods In a separate chart sheet –Workbook Charts or Sheet –Chart »Chart properties and methods

Referring to a Chart In a worksheet: –MsgBox(Worksheets(“sheet1”).ChartObjects(1).ChartTitle.Text) In a chart sheet: –MsgBox(thisworkbook.Sheets("chart1").chartTitle.Text)

Chart Example: Comparing the Charges of Three Service Plans

Recording Chart Macro Sub ChartMC() ' ' ChartMC Macro ' Macro recorded 11/16/2005 by cob Charts.Add ActiveChart.ChartType = xlLine ActiveChart.SetSourceData Source:=Sheets("Sheet1").Range("A1:D20"), PlotBy _ :=xlColumns ActiveChart.SeriesCollection(1).Delete ActiveChart.SeriesCollection(1).XValues = "=Sheet1!R2C1:R20C1" ActiveChart.SeriesCollection(2).XValues = "=Sheet1!R2C1:R20C1" ActiveChart.SeriesCollection(3).XValues = "=Sheet1!R2C1:R20C1" ActiveChart.Location Where:=xlLocationAsNewSheet With ActiveChart.HasTitle = True.ChartTitle.Characters.Text = "Plans Comparsion".Axes(xlCategory, xlPrimary).HasTitle = True.Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = "Hours Used".Axes(xlValue, xlPrimary).HasTitle = True.Axes(xlValue, xlPrimary).AxisTitle.Characters.Text = "Charges" End With End Sub

Chart’s SeriesCollection A collection of data Series for Y axis Series object: –XValues property: the series for X-axis

Adding a New Data Series to an Existing Chart activechart.SeriesCollection.add source:=Worksheets("sheet1").Range("e1:e20")

Deleting a Data Series from An Existing Chart activechart.SeriesCollection(1).delete

SeriesCollection Demo

Private Sub CommandButton1_Click() 'ActiveChart.SeriesCollection.Add Source:=Worksheets("sheet1").Range(RefEdit1.Text) ThisWorkbook.Sheets("chart1").SeriesCollection.Add Source:=Range(RefEdit1.Text) ListBox1.Clear Dim i As Integer For i = 1 To ThisWorkbook.Sheets("chart1").SeriesCollection.Count ListBox1.AddItem (ThisWorkbook.Sheets("chart1").SeriesCollection(i).Name) Next i End Sub Private Sub CommandButton2_Click() Dim i As Integer For i = 1 To ThisWorkbook.Sheets("chart1").SeriesCollection.Count If ThisWorkbook.Sheets("chart1").SeriesCollection(i).Name = ListBox1.Value Then ThisWorkbook.Sheets("chart1").SeriesCollection(i).Delete Exit For End If Next i ListBox1.Clear For i = 1 To ThisWorkbook.Sheets("chart1").SeriesCollection.Count ListBox1.AddItem (ThisWorkbook.Sheets("chart1").SeriesCollection(i).Name) Next i End Sub Private Sub UserForm_Initialize() Dim i As Integer For i = 1 To ThisWorkbook.Sheets("chart1").SeriesCollection.Count ListBox1.AddItem (ThisWorkbook.Sheets("chart1").SeriesCollection(i).Name) Next i End Sub

An MIS Query Downloaded from a Server

Macro to create a column chart to compare the projected sales and actual sales Charts.Add ActiveChart.ChartType = xlColumnClustered ActiveChart.SetSourceData Source:=Sheets("Sheet4").Range("A1:E5"), PlotBy:= _ xlColumns ActiveChart.SeriesCollection(3).Delete ActiveChart.SeriesCollection(1).XValues = "=Sheet4!R2C2:R5C2" ActiveChart.SeriesCollection(2).XValues = "=Sheet4!R2C2:R5C2" ActiveChart.Location Where:=xlLocationAsNewSheet With ActiveChart.HasTitle = True.ChartTitle.Characters.Text = "Comparison of Actual Sales with Projection".Axes(xlCategory, xlPrimary).HasTitle = True.Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = "Dollar Amount".Axes(xlValue, xlPrimary).HasTitle = False End With

Rewrite the macro to generalize the worksheet name Sub MyChart() Dim r As Range ActiveSheet.Range("a1").Select Set r = ActiveCell.CurrentRegion Dim sheetName As String sheetName = ActiveSheet.Name Charts.Add ActiveChart.ChartType = xlColumnClustered ActiveChart.SetSourceData Source:=r, PlotBy:=xlColumns ActiveChart.SeriesCollection(3).Delete ActiveChart.SeriesCollection(1).XValues = "=" & sheetName & "!R2C2:R5C2" ActiveChart.SeriesCollection(2).XValues = "=" & sheetName & "!R2C2:R5C2" ActiveChart.Location Where:=xlLocationAsNewSheet With ActiveChart.HasTitle = True.ChartTitle.Characters.Text = "Comparison of Actual Sales with Projection".Axes(xlCategory, xlPrimary).HasTitle = True.Axes(xlCategory, xlPrimary).AxisTitle.Characters.Text = "Dollar Amount".Axes(xlValue, xlPrimary).HasTitle = False End With End Sub