170 likes | 175 Views
Explore list and data management using Excel, covering the data hierarchy, manipulating lists, filtering data, and working with pivot tables for summarization. Understand database issues and when to opt for a database management system.
E N D
CPSC 130Computing With Spreadsheets List Management and Macros Week 7
Outline • List and Data Management • Database Issues • In closing … Brenda Vander Linden and Aaron Armstrong
List and Data Management • Recall the data hierarchy: • fields • records • files • Working with Excel lists (aka files) • Converting data to information Brenda Vander Linden and Aaron Armstrong
A Data Hierarchy • Bit • Character, string and number • Field • Record • File • Database Brenda Vander Linden and Aaron Armstrong
Information from Lists • Manipulating lists • Filtering lists • Similar to database query features • Summarizing lists with pivot tables • Similar to database report functions Brenda Vander Linden and Aaron Armstrong
Feature Creep • Now we have facilities for sorting, input, etc., as well as a means to deal with multiple worksheets. • We get something approaching a database management system (DBMS), without having a one. Brenda Vander Linden and Aaron Armstrong
Database Issues • Database - a collection of data that is: • persistent • too large to fit into main memory • Database Management System - a system that maintains and provides multi-user access to a database, and whose operation is: • efficient • convenient • safe Brenda Vander Linden and Aaron Armstrong
Database Issues, cont. • When to use databases (and not Excel): • Large data sets • Formed input and output • Arbitrary and complicated queries • Multiple users • Security • CPSC-135 covers databases Brenda Vander Linden and Aaron Armstrong
“All our knowledge brings us nearer to our ignorance, All our ignorance brings us nearer to death, But nearness to death, no nearer to God. Where is the Life we have lost in living? Where is the wisdom we have lost in knowledge? Where is the knowledge we have lost in information? The cycles of Heaven in twenty centuries Bring us farther from God and nearer to the Dust. [98] T. S. Eliot, Choruses From ‘The Rock’, Selected Poems (New York: Harcourt, Brace & World, 1964), p. 107. Brenda Vander Linden and Aaron Armstrong
What is a macro? • A set of instructions telling Excel what commands to execute • Written in Visual Basic for Applications (VBA) • Recorded with the Macro Recorder Brenda Vander Linden and Aaron Armstrong
Recording a macro • NameAndCourse macro • Shortcut key • Record macro • Stop recording Brenda Vander Linden and Aaron Armstrong
Elements of a Macro • Sub/End Sub • Comments • Variables • Properties • With Statement Brenda Vander Linden and Aaron Armstrong
Step Into • Executes one command of the macro • Other debugging commands available Brenda Vander Linden and Aaron Armstrong
Personal Macro workbook • Opened every time Excel starts • Only on your machine • Always accessible Brenda Vander Linden and Aaron Armstrong
User interaction functions • InputBox • MsgBox • Example: modifying another macro Brenda Vander Linden and Aaron Armstrong
The If Statement Sub Pepsi() ActiveCell = _ InputBox("Enter something interesting") If ActiveCell = "Britney" Then MsgBox ("Try Pepsi") Else MsgBox ("Try Britney") End If End Sub Brenda Vander Linden and Aaron Armstrong
The Do Statement Sub Redden() Range("A4").Select Do Until ActiveCell = "" Selection.Font.ColorIndex = 3 ActiveCell.Offset(1, 0).Select Loop End Sub Brenda Vander Linden and Aaron Armstrong