Introduction to Programming with Basic and Excel Macros

1st ed, 2018, 400 pages, $59.95
ISBN 978-0-89641-563-8


Basic has evolved into a programming language with an object-oriented option used for major applications. It is still an excellent choice for introducing the features a programming language has and how all of these features are used to solve real problems. The ideas of computation, logical tests, the repetition of blocks of code, the use of random numbers, graphics, and arrays are all presented in an accessible way. The chapters are designed to present the language features commonly used in algorithm development.

purchase button
Review button

This text uses Visual Basic 6.0 as its language, but the downloadable Basic program at could be used. When discussing macros, the Basic program built into Excel is used. The Excel version of Basic is part of the Excel program.

Each chapter has several features to aid the learning process. The On Your Own sections are short answer questions to help ensure the material presented is understood. The SYNTAX boxes area a way to highlight the syntactical aspects of commands for ready reference. The Putting It All Together sections are a collection of problems for the reader that use the features introduced in the chapter as well as ideas from previous chapters. The material is well-suited for independent and small group learning as well as classes in various settings where students are exploring what computing is all about.


Chapter 1: Getting Started

  • Procedure for Starting
  • Printing the Program
  • saving the Program
  • Reloading the Program
  • Exiting Basic

Chapter 2: Screen Output

  • Programming Practices and Conventions
  • The REM Statement
  • the CLS Command
  • The Print Command
  • Print with a Semicolon
  • Print with a Comma
  • Positioning Output on the Screen
  • Drawing Pictures
  • Putting it All Together

Chapter 3: Input Values and Output Displays

  • Data Type Values
  • Variables
  • Assignment Statements
  • Dialog Boxes
  • Displaying Values
  • Numeric Values as Input
  • Creating User-Friendly Output
  • Putting It all Together

Chapter 4: Numeric Calculations

  • Operations, Functions and Expressions
  • Operation Hierarchy
  • Subexpressions
  • Built-in Functions
  • Concatenation
  • Formatting Output
  • Putting It All Together

Chapter 5: Decision Making

  • Simple Comparisons
  • Numeric Comparisons
  • Strings
  • Character Represnetation
  • Dictionary Ordering
  • String Comparisons
  • Conditional Statements
  • Simple If-Blocks
  • The Else Option
  • Compound Condition If-block
  • Multi-case If-Blocks
  • Putting It All Together

Chapter 6: Branching

  • Line Labels
  • Unconditional Branching
  • Repetition of Code
  • Conditional Branching
  • Repeating Blocks of Code
  • Repetition of Number of Times
  • Sentinels
  • Prompt and Echo
  • User Interrogation Technique
  • Putting It All Together

Chapter 7: Repetition of Code

  • The For...NextLoop
  • The Step Parameter
  • Program Applications
  • Supply-Demand Curves
  • Generalized Functionality
  • Nested Loops
  • DoWhile...Loop Construct
  • While Loop and a Sentinel
  • approximating a Solutiobn
  • Putting It All Together

Chapter 8: Random Numbers

  • The Rnd Function
  • Using Randomize
  • Coin Tossing
  • Tossing a Biased Coin
  • Die Rolling
  • Scaling the Rnd Function
  • A Simulation
  • Putting It All Together

Chapter 9: Graphics

  • Resolution and Color
  • Coloring Pixels
  • Drawing Lines
  • Using the PSet Command to Draw a Line
  • Using the Command Line
  • Drawing Rectangles
  • Drawing Circles
  • Drawing Arcs
  • Drawing Sectors
  • Drawing Ellipses
  • FullStyle and FullColor
  • Drawing a Line Graph
  • Drawing a Pie Chart
  • Crawing a Histogram
  • Putting It All Together

Chapter 10: 1-Dimensional Arrays

  • Defining an Array
  • The Syntax of Defining Arrays
  • Assigning and Using Values in an Array
  • Finding the Average and the Standard Deviation
  • File Input
  • File Output and EOF()
  • Searching an Array
  • Finding the Smallest Element in an Array
  • File InputInterchanging Two elements in an Array
  • Sorting an Array
  • Finding a Distribution of Elements
  • Parallel Arrays
  • Inner Products of Vectors (optional)
  • Drawing a Histogram
  • Putting It all Together

Chapter 11: 2-Dimensional Arrays

  • Defining a 2-Dimensional Array
  • The Syntax for 2-Dimensional Arrays
  • Assigning and Accessing Values in 2-Dim Array
  • Nested For...Next Loops
  • Traversing a 2-Dimensional Array
  • Inputting Values from a File
  • Grade Report
  • Translating the Data Range
  • Representing Data in a 2-Dimensional Array
  • Matrix Addition (optional)
  • Simple Search to Find Information
  • Putting It All Together

Chapter 12: 2-Features of Excel

  • The Excel Screen
  • The Developer Tab
  • Logic and Formulas in Exel
  • Formulas with Values as Arguments
  • Functions Requiring Lists as Arguments
  • Conditions in Excel
  • Formulas with List and Conditions as Arguments
  • Cell Addresses in Conditions for Ranges
  • The COUNTIF() Function Using Complex Conditions
  • Multiple Conditions for Selection
  • The SUMIFS() Formula
  • Putting It All Together

Chapter 13: Addressing and the Copy Operation

  • Setting the Stage for Intermediate Code
  • Excel's Intermediate Code for Expressions
  • The Copy Operation
  • Interest Table
  • Absolute Addressing
  • Addressing Options in Computations
  • Putting It All Together

Chapter 14: Recorded Macros

  • Setting up a Recorded Macro
  • Recording the Macro
  • Saving Spreadsheets with Macros
  • Object-Oriented Essentials
  • Components of Oabjects
  • Object Properties
  • Object Methods
  • Object Hierarchy
  • Objects in Excel
  • The Cells(*,*) Object
  • The Value of Using Macros
  • Identifying Ranges
  • The Range() Object
  • Cells() Object
  • How Range() and Cells() are Related
  • Basic Code for Recorded Macro
  • Formatting Cells Using a Macro
  • Formatting a Range of Cells
  • Putting It All Together

Chapter 15: Writing Excel Macros with Basic

  • Objects
  • A Macro for Input
  • Removing Duplicates
  • Editing a Macro
  • Case Study I: Cattle Feeders annual Report
  • Part 1: Entering Raw Data and Analyzing
  • Part 2: Descriptive Statistics
  • Part 3: Distribution Brackets and Evlauation
  • Putting It All Together

Chapter 16: Case Studies

  • Case Study II: Student Loan Repayment Information
  • Amortization Schedule
  • Building a Loan Payment Report
  • Entering Data for Loan Repayment
  • Payment Amounts for 5 and 10-Year Loans
  • Amortization Table Sample
  • Case Study III: Temperature Monitoring System
  • Case Study IV: Creating an Invoice Form for Biling
  • Part 1: Fixed Text
  • Part 2: Customer Information
  • Part 3: Processing Orders
  • Case Study V: Understanding Walking Motion
  • Understanding the Experiment
  • Input Using Tab Delimited Data Files
  • What We Are Aiming For
  • Part 1: Initialization
  • Part 4: Convert Pixel Coordinates to Metyric Measure
  • Part 5: Enter the Scaled Data into Ecel
  • Putting It All Together

Appendix A: Translating Language Suntax to Basic

Appendix B: Odd Solutions

Appendix C: Index


    Julia Buffinton, Professor of Linguistics at the University of Maryland, currently works in Washington D.C. in the field of data analysis. Gary Haggard is a Professor of Department of Computer Science at Bucknell University while Wade Hutchison is a Developmental Engineer with the College of Engineering at Bucknell University. He uses Visual Basic to build applications with graphic use interfaces for undergraduate and researdch students.