(Ebook PDF) VBA For Modelers Developing Decision Support Systems 5th Download
(Ebook PDF) VBA For Modelers Developing Decision Support Systems 5th Download
https://ebooksecure.com/product/ebook-pdf-vba-for-modelers-
developing-decision-support-systems-5th/
http://ebooksecure.com/product/ebook-pdf-analytics-data-science-
artificial-intelligence-systems-for-decision-support-11th-
edition/
https://ebooksecure.com/download/analytics-data-science-
artificial-intelligence-systems-for-decision-support-ebook-pdf/
http://ebooksecure.com/product/ebook-pdf-exploring-vba-for-
microsoft-office-2016-brief/
http://ebooksecure.com/product/ebook-pdf-analytics-and-decision-
support-in-health-care-operations-management-3rd-edition/
(Original PDF) Developing Communities for the Future
5th Australia Edition
http://ebooksecure.com/product/original-pdf-developing-
communities-for-the-future-5th-australia-edition/
http://ebooksecure.com/product/original-pdf-decision-analysis-
for-management-judgment-5th-edition/
http://ebooksecure.com/product/ebook-pdf-developing-management-
skills-a-comprehensive-guide-for-leaders-5th-edition/
http://ebooksecure.com/product/ebook-pdf-managerial-accounting-
tools-for-business-decision-making-5th-canadian-edition/
http://ebooksecure.com/product/ebook-pdf-developing-
multicultural-counseling-competence-a-systems-approach-3rd-
edition/
About the Author
S. Christian Albright
Chris Albright got his B.S. degree in Mathematics from Stanford in 1968 and his
Ph.D. degree in Operations Research from Stanford in 1972. Until his retirement
in 2011, he taught in the Operations & Decision Technologies Department in
the Kelley School of Business at Indiana University. His teaching included courses
in management science, computer simulation, and statistics to all levels of busi-
ness students: undergraduates, MBAs, and doctoral students. He has published
over 20 articles in leading operations research journals in the area of applied
probability and he has authored several books, including Practical Management
Science, Data Analysis and Decision Making, Data Analysis for Managers, Spread-
sheet Modeling and Applications, and VBA for Modelers. He jointly developed
StatTools, a statistical add-in for Excel, with the Palisade Corporation. In “retire-
ment,” he continues to revise his books, he works as a consultant for Palisade,
and he has developed a commercial product, Excel Now!, an Excel tutorial.
On the personal side, Chris has been married to his wonderful wife Mary for
43 years. They have a special family in Philadelphia: their son Sam, his wife Lindsay,
and their two sons, Teddy and Archer. Chris has many interests outside the aca-
demic area. They include activities with his family (especially traveling with Mary),
going to cultural events at Indiana University, power walking, and reading. And
although he earns his livelihood from statistics and management science, his real
passion is for playing classical music on the piano.
vi
Copyright 2016 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Contents
Preface xvi
vii
Copyright 2016 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
viii Contents
4 Recording Macros 35
4.1 Introduction 35
4.2 How to Record a Macro 35
4.3 Changes from Excel 2007 to Later Versions 37
4.4 Recorded Macro Examples 37
4.5 Summary 47
Copyright 2016 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Contents ix
9 Arrays 177
9.1 Introduction 177
9.2 Exercise 177
9.3 The Need for Arrays 179
9.4 Rules for Working with Arrays 180
9.5 Examples of Arrays in VBA 183
9.6 Array Functions 199
9.7 Summary 199
Copyright 2016 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
x Contents
Copyright 2016 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Contents xi
Copyright 2016 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
xii Contents
Copyright 2016 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Contents xiii
Copyright 2016 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
xiv Contents
Copyright 2016 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Contents xv
Index 700
Copyright 2016 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Preface
I wrote VBA for Modelers for students and professionals who want to create deci-
sion support systems (DSSs) using Microsoft Excel–based spreadsheet models. The
book does not assume any prior programming experience. It contains two parts.
Part I covers the essentials of VBA (Visual Basic for Applications) programming,
and Part II provides many applications with their associated programming code.
This part assumes that readers are either familiar with spreadsheet modeling or are
taking a concurrent course in management science or operations research. There
are many excellent books available for VBA programming, many others covering
decision support systems, and still others for spreadsheet modeling. However, I
have not found a book that attempts to unify these subjects in a practical way.
VBA for Modelers is designed for this purpose, and I hope you will find it to be an
important resource and reference in your own work.
Copyright 2016 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Preface xvii
Approach
I like to teach (and learn) through examples. I have found that I can learn a pro-
gramming language only if I have a strong motivation to learn it. I suspect that
Copyright 2016 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
xviii Preface
most of you are the same. The applications in the latter chapters are based on
many interesting management science models. They provide the motivation for
you to learn the material. The examples illustrate that this book is not about pro-
gramming for the sake of programming. Instead, it is about developing useful
applications for business. You probably already realize that Excel modeling skills
make you more valuable in the workplace. This book will help you develop VBA
skills that make you much more valuable.
Copyright 2016 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Preface xix
Copyright 2016 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
xx Preface
Copyright 2016 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Preface xxi
model to import the data from an Access database into Excel. This will work only
in Excel 2000 or a more recent version. Finally, Chapter 13 uses the Office File-
Dialog object. This works only in Excel XP (2002) or a more recent version.
The book is also supported by a Web site at www.kelley.iu.edu/albrightbooks.
The Web site contains errata and other useful information, including information
about my other books.
Acknowledgments
I would like to thank all of my colleagues at Cengage Learning. Foremost among
them are my current editor, Aaron Arnsbarger, and my former editors, Curt
Hinrichs and Charles McCormick. The original idea was to develop a short VBA
manual to accompany our Practical Management Science book, but Curt
persuaded me to write an entire book. Given the success of the first four
editions, I appreciate Curt’s insistence. I am also grateful to many of the profes-
sionals who worked behind the scenes to make this book a success:
● Brad Sullender, Content Developer; Heather Mooney, Marketing Manager;
Kristina Mose-Libon, Art Director; and Sharib Asrar as the Project Manager
at Lumina Datamatics.
Next, I would like to thank the reviewers of past editions of the book.
Thanks go to
● Gerald Aase, Northern Illinois University; Ravi Ahuja, University of Florida;
Grant Costner, University of Oregon; R. Kim Craft, Rollins College; Lynette
Molstad Gorder, Dakota State University; and Jim Hightower, California State
University-Fullerton; Don Byrkett, Miami University; Kostis Christodoulou,
London School of Economics; Charles Franz, University of Missouri; Larry
LeBlanc, Vanderbilt University; Jerry May, University of Pittsburgh; Jim Morris,
University of Wisconsin; and Tom Schriber, University of Michigan.
Finally, I want to thank my wife, Mary. She continues to support my book-
writing activities, even when it requires me to work evenings and weekends
in front of a computer. I also want to thank our Welsh corgi Bryn, who faith-
fully accompanies her daddy when he goes upstairs to do his work. She doesn’t
add much technical assistance, but she definitely adds a lot of motivational
assistance.
S. Christian Albright
(e-mail at [email protected],
Web site at www.kelley.iu.edu/albrightbooks)
Bloomington, Indiana
January 2015
Copyright 2016 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Copyright 2016 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Part I
VBA Fundamentals
This part of the book is for readers who need an introduction to programming in
general and Visual Basic for Applications (VBA) for Excel in particular. It dis-
cusses programming topics that are common to practically all programming lan-
guages, including variable types and declarations, control logic, looping, arrays,
subroutines, and error handling. It also discusses many topics that are specific to
VBA and its use with Excel, including the Excel object model; recording macros;
working with ranges, workbooks, worksheets, charts, and other Excel objects;
developing user forms (dialog boxes); and automating other applications, includ-
ing Word, Outlook, Excel’s Solver add-in, and Palisade’s @RISK add-in, with
VBA code.
Many of the chapters in Part I present a business-related exercise immediately
after the introductory section. The objective of each such exercise is to motivate
you to work through the details of the chapter, knowing that many of these
details will be required to solve the exercise. The finished files are included in the
online materials, but I urge you to try the exercises on your own, before looking
at the solutions.
The chapters in this part should be read in approximately the order they are
presented, at least up through Chapter 12. Programming is a skill that builds
upon itself. Although it is not always possible to avoid referring to a concept
from a later chapter in an earlier chapter, I have attempted to refrain from doing
this as much as possible. The one small exception is in Chapters 6 (on ranges)
and 7 (on control logic and loops). It is almost impossible to do any interesting
programming in Excel without knowing about ranges, and it is almost impossible
to do any interesting programming in general without knowing about control
logic and loops. I compromised by putting the chapter on ranges first and using
some simple control logic and loops in it. I don’t believe this should cause any
problems.
Copyright 2016 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).
Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.
Discovering Diverse Content Through
Random Scribd Documents
Middlesex against Wilkes in April, 1769, although the latter polled
1143 votes to Colonel Luttrell's 296. He was made adjutant-
general of the land forces in Ireland; but in 1772, being
discontented with the post, threatened to resign his seat for
Middlesex, and so renew the struggle with Wilkes. The
circumstances in which the appointment was made are noticed by
Junius (August 22, 1770).
[157] Walpole, writing in May, 1770, speaks of "a winter-Ranelagh
erecting in Oxford Road at the expense of sixty thousand
pounds." "Imagine Balbec in all its glory!" he writes, when it was
approaching completion in April, 1771. The Pantheon, built by
Wyatt, was opened on January 27, 1772, "to a crowded company
of between fifteen hundred and two thousand people. In point of
consequence, the company were an olio of all sorts; peers,
peeresses, honourables, and right honourables, jew brokers,
demireps, lottery insurers, and quack doctors" (Annual Register).
It was destroyed by fire on January 16, 1792.
Gentlemen and ladies could only subscribe to the Pantheon on the
recommendation of a peeress, in order to prevent, as the
proprietors announce in the Gazetteer (December 17, 1771),
"such persons only from obtaining subscriptions whose
appearance might not only be improper but subversive of that
elegance and propriety which they wish on every occasion to
preserve." On the other hand, once admitted to be subscribers,
they could introduce friends of any or no character. The struggle
between the two factions was decided by the efforts of a number
of gentlemen, headed by Mr. William Hanger, who, with drawn
swords, succeeded in forcing an entrance for Mrs. Baddeley.
Possibly Gibbon meant, instead of repeating "Gentlemen
Proprietors," to mark the contrast by writing "Gentlemen
Subscribers" in the second sentence. The dispute is alluded to in a
poem published in 1772, called The Pantheon Rupture; or, A
Dispute between Elegance and Reason. In their dialogue Elegance
says—
And hate the very name of a divorce;
Besides the Managers admit none in,
That e'er were known to have committed sin;—
The needy dame, who makes of love a trade,
These Realms of Virtue must not dare invade;
The company's selected from a class
Too chaste to suffer demireps to pass.
Reason.
Elegance.
. . . . . . . . .
"E. Gibbon."
[371] Françoise Lambertine, daughter of Baron Kolbel, married,
September 1, 1767, "a rich West Indian," Ralph Payne (knighted
in 1771), a son of the Governor of St. Christopher's, and himself
Governor of the Leeward Islands (1771-75). Sir Ralph represented
various constituencies in Parliament from 1768 to 1799, and, with
his wife, was prominent in London society. He was created
Viscount Lavington. Lady Lavington survived her husband, who
died in 1807, as Governor of Antigua and a bankrupt.
[372] The Hon. Fred. Cornwallis, Archbishop of Canterbury.
[373] Lord Mansfield, Chief Justice of the Court of King's Bench.
[374] General (afterwards Sir William) Howe defeated Washington
at Brandywine on September 11, 1777, and took possession of
Philadelphia on the 27th.
[375] The Parliamentary session opened on November 18.
[376] Lord Chatham, in the House of Lords, moved an
amendment to the address, that the army should be recalled, the
late Acts rescinded, and every effort used to reunite with America.
The same motion was made in the Lower House. But the
amendments were rejected by large majorities in both Houses. On
December 2, Fox moved for a committee of the whole House to
inquire into the state of the nation, including the expenses and
resources of the nation, the loss of men, the state of trade, the
present situation of the war, our foreign relations, and the
progress made by the Commissioners in bringing about peace.
Lord North accepted the motion, and the committee sat for the
first time on February 2, 1778. Parliament was adjourned from
December 11, 1777, to January 20, 1778.
[377] General Burgoyne, after capturing Ticonderoga, pushed
forwards towards the Hudson River, intending to invade the
United States from the side of Canada. His supplies began to fail.
The American forces gathered at Saratoga, and after several days'
fighting, surrounded the British troops, whose strength was
Welcome to Our Bookstore - The Ultimate Destination for Book Lovers
Are you passionate about testbank and eager to explore new worlds of
knowledge? At our website, we offer a vast collection of books that
cater to every interest and age group. From classic literature to
specialized publications, self-help books, and children’s stories, we
have it all! Each book is a gateway to new adventures, helping you
expand your knowledge and nourish your soul
Experience Convenient and Enjoyable Book Shopping Our website is more
than just an online bookstore—it’s a bridge connecting readers to the
timeless values of culture and wisdom. With a sleek and user-friendly
interface and a smart search system, you can find your favorite books
quickly and easily. Enjoy special promotions, fast home delivery, and
a seamless shopping experience that saves you time and enhances your
love for reading.
Let us accompany you on the journey of exploring knowledge and
personal growth!
ebooksecure.com