Programming Excel With VBA A Practical Real World Guide Flavio Morgado - Instantly Access The Full Ebook Content in Just A Few Seconds
Programming Excel With VBA A Practical Real World Guide Flavio Morgado - Instantly Access The Full Ebook Content in Just A Few Seconds
com
https://textbookfull.com/product/programming-excel-with-vba-
a-practical-real-world-guide-flavio-morgado/
OR CLICK HERE
DOWLOAD EBOOK
https://textbookfull.com/product/excel-vba-programming-for-
dummies-5th-edition-michael-alexander/
textbookfull.com
https://textbookfull.com/product/engineering-analysis-modeling-with-
excel-vba-version-9-0-9th-edition-matthew-e-moran/
textbookfull.com
Learning Java An Introduction to Real World Programming
with Java Marc Loy
https://textbookfull.com/product/learning-java-an-introduction-to-
real-world-programming-with-java-marc-loy/
textbookfull.com
https://textbookfull.com/product/vba-for-modelers-developing-decision-
support-systems-with-microsoft-office-excel-5th-edition-s-christian-
albright/
textbookfull.com
https://textbookfull.com/product/learning-java-an-introduction-to-
real-world-programming-with-java-5th-edition-marc-loy/
textbookfull.com
Flavio Morgado
Programming Excel with VBA: A Practical Real-World Guide
Flavio Morgado
Rio de Janeiro, Brazil
ISBN-13 (pbk): 978-1-4842-2204-1 ISBN-13 (electronic): 978-1-4842-2205-8
DOI 10.1007/978-1-4842-2205-8
Library of Congress Control Number: 2016957877
Copyright © 2016 by Flavio Morgado
This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the material is
concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation, broadcasting, reproduction
on microfilms or in any other physical way, and transmission or information storage and retrieval, electronic
adaptation, computer software, or by similar or dissimilar methodology now known or hereafter developed.
Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol with every
occurrence of a trademarked name, logo, or image we use the names, logos, and images only in an editorial fashion
and to the benefit of the trademark owner, with no intention of infringement of the trademark.
The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are not identified
as such, is not to be taken as an expression of opinion as to whether or not they are subject to proprietary rights.
While the advice and information in this book are believed to be true and accurate at the date of publication, neither
the authors nor the editors nor the publisher can accept any legal responsibility for any errors or omissions that may
be made. The publisher makes no warranty, express or implied, with respect to the material contained herein.
Cover image designed by FreePik
Managing Director: Welmoed Spahr
Lead Editor: Gwenan Spearing
Technical Reviewer: Fabio Claudio Ferracchiati
Editorial Board: Steve Anglin, Pramila Balan, Laura Berendson, Aaron Black, Louise Corrigan,
Jonathan Gennick, Robert Hutchinson, Celestin Suresh John, Nikhil Karkal, James Markham,
Susan McDermott, Matthew Moodie, Natalie Pao, Gwenan Spearing
Coordinating Editor: Mark Powers
Copy Editor: Kim Wimpsett
Compositor: SPi Global
Indexer: SPi Global
Artist: SPi Global
Distributed to the book trade worldwide by Springer Science+Business Media New York,
233 Spring Street, 6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail
orders-ny@springer -sbm.com, or visit www.springer.com. Apress Media, LLC is a California LLC and the sole
member (owner) is Springer Science + Business Media Finance Inc (SSBM Finance Inc). SSBM Finance Inc is a
Delaware corporation.
For information on translations, please e-mail [email protected], or visit www.apress.com.
Apress and friends of ED books may be purchased in bulk for academic, corporate, or promotional use. eBook
versions and licenses are also available for most titles. For more information, reference our Special Bulk Sales–
eBook Licensing web page at www.apress.com/bulk-sales.
Any source code or other supplementary materials referenced by the author in this text are available to
readers at www.apress.com/9781484222041. For detailed information about how to locate your book’s source
code, go to www.apress.com/source-code/. Readers can also access source code at SpringerLink in the
Supplementary Material section for each chapter.
Printed on acid-free paper
To my beloved sons, Georgia and Diego.
You are the light of my life!
Contents at a Glance
Afterword.............................................................................................................. 779
Index ..................................................................................................................... 783
v
Contents
vii
■ CONTENTS
viii
■ CONTENTS
ix
■ CONTENTS
x
■ CONTENTS
xi
■ CONTENTS
xii
■ CONTENTS
Afterword.............................................................................................................. 779
Index ..................................................................................................................... 783
xiii
About the Author
Flavio Morgado is a food engineer with a master’s degree in food science and technology. He is also a VBA
professional developer, a technical writer, an English to Brazilian Portuguese technical translator, and a
professor at UNIFESO – Centro Universitário Serra dos Órgãos in the city of Teresopolis in Rio de Janeiro,
Brasil.
He has written more than 30 books (and translated an equal number) — all published just in Brazil.
Flavio lives in Teresopolis; when he is not teaching, writing, or developing a love of something (or
somebody…), he is running or riding his mountain bike throughout the Teresopolis Mountains, followed by
his 11 dogs (2016’s dog count).
xv
About the Technical Reviewer
Fabio Claudio Ferracchiati is a senior consultant and a senior analyst/developer using Microsoft
technologies. He works for BluArancio (www.bluarancio.com). He is a Microsoft Certified Solution
Developer for .NET, a Microsoft Certified Application Developer for .NET, a Microsoft Certified Professional,
and a prolific author and technical reviewer. Over the past ten years, he’s written articles for Italian and
international magazines and coauthored more than ten books on a variety of computer topics.
xvii
Acknowledgments
This book shows how to improve worksheet applications using Visual Basic for Applications (VBA). A great
part of it was inspired or is based on content and knowledge available for free on the Internet.
So, I like to thank the existence of these VBA Internet sites (in alphabetical order):
• Better Solutions: www.bettersolutions.com/
• Excel Matters: http://excelmatters.com/
• ExcelVBA: http://excelevba.com.br/
• Mr. Excel: www.mrexcel.com
• Microsoft System Development Network (MSDN): https://msdn.microsoft.com/
• Ozgrid: www.ozgrid.com/VBA/find-method.htm
• Pearson Software Consulting: www.cpearson.com/
• Ron de Bruin Excel Automation: www.rondebruin.nl/win/section2.htm
• StackExchange: http://stackexchange.com/
• StackOverflow em Português: http://pt.stackoverflow
• StackOverflow: http://stackoverflow
• VB-fun.de: www.vb-fun.de/
And thanks for the existence of these nutrient Internet sites (in alphabetical order):
• Agricultural Research Serving of United States: www.ars.usda.gov
• EatingWell: www.eatingwell.com/
• Food and Agriculture Organization for the United Nations: www.fao.org
• National Heart, Lung, and Blood Institute: www.nhlbi.nih.gov
• The Dash Diet Eating Plan: dashdiet.org
• Wikipédia: www.wikipedia.com
I also want to thank Microsoft and all the people on the Microsoft Excel development team for giving
us Excel—a superb piece of software that is versatile and powerful. As a professional developer, I know how
difficult it is to produce something so good, even though it is not perfect, but what is? Please Microsoft,
receive my most profound respect and compliments.
xix
Introduction
This book was created to teach you how to use Visual Basic for Applications (VBA) to automate worksheet
applications.
It is a code book that was written to teach everyone, including people with zero experience in
programming and people with decent programming knowledge, how to use and apply programming
techniques to better interact with the users of your Microsoft Excel solutions in a more professional way.
It uses some ready-made worksheet applications as practical examples of how you can produce solid,
precise, and reliable worksheet applications based on VBA programming.
First I’ll introduce you to the VBA environment and the language structure and show you some basic
examples that will take you on a consistent journey through the Excel object model. All the proposed
examples use VBA to teach you how to interact with the Excel object model and its many properties,
methods, and events.
As a basic strategy to teaching Excel VBA programming, this book uses the VBA Immediate window
to first test each proposed Excel feature before showing how to use it in a code procedure. It is full of
programming examples whose complexity grows from the book’s beginning to its end. This means it was
written to be read one chapter at a time, with each chapter using the knowledge of previous chapters to
provide a jump on your programmer skills.
My teaching strategy is to show a UserForm interface or code procedure step-by-step and to comment
on all its instructions, one at a time, to give you a better understanding of how the VBA code can use good
programming techniques to produce the desired result, with clear, concise, and reusable code.
xxi
■ INTRODUCTION
• Chapter 3, “Programming the Microsoft Excel Workbook Object,” talks about the
second layer of the Microsoft Excel object model, which represents the Workbooks
collection and contains all the open Workbook objects inside the main Excel window.
You will learn about how and when the Workbook object events fire and will see
the VBA UserForm and its controls, learning how to use the ListBox control and its
interface (properties, methods, and events) to interact with the Workbook object
using VBA code.
• Chapter 4, “Programming the Microsoft Excel Worksheet Object,” touches on the
third object level in the Excel object model hierarchy: the Worksheet object, which
represents the sheet tab in a Excel workbook file. It also shows how its programmable
interface is composed (it properties, methods, and events). In this chapter, you will
use again a VBA UserForm to learn how to add, delete, copy, move, rename, sort, and
change sheet tab visibility inside a workbook file. You will also learn the many ways
(and the preferable one) to reference sheet tabs in the VBA code and how to control
the “cascade events” phenomenon that happens with VBA objects.
• Chapter 5, “Programming the Microsoft Excel Range Object,” talks about the deepest
object inside the Excel object model hierarchy: the Range object, which can represent
any number of cells inside a Worksheet object. Using another UserForm interface,
you will learn how to programmatically define the cell addresses that compose any
selected range, how to use VBA to name a range (using the Names collection), how to
use the VBA Collection object, and how to produce a similar interface to the Excel
Name Manager interface using VBA, improving the Excel interface by allowing you to
change the range name visibility inside the workbook file.
• Chapter 6, “Special Range Object Properties and Methods,” expands your knowledge
about the Range object by covering the Cells and CurrentRegion properties and
the End, OffSet, Find, AutoFilter, Sort Copy, and PasteSpecial methods, using
again the UserForm approach. At the end of this chapter you are presented with the
frmFindFoodItems UserForm that uses most of this knowledge to find food items in
the USDA food table using different search criteria (by food item name or nutrient
content).
• Chapter 7, “Using Excel as a Database Repository,” presents you with a
programmable approach to implementing a database storage system to store
worksheet data as database records in unused worksheet rows, based on a data
validation list cell and range names. This chapter uses all the knowledge gathered
so far to produce a standard code module full of procedures that use module-level
constant values to define the database parameters, allowing you to adapt it to any
worksheet application design.
• Chapter 8, “Creating and Setting a Worksheet Database Class,” expands the
database code module to a Class module that uses range names to store the
database properties inside unused worksheet rows. It defines the SheetDBEngine
class interface, showing how to implement its properties, methods, and events.
To allow you to easily use the SheetDBEngine class, this chapter also presents the
frmDBPRoperties UserForm, which was produced as a database wizard, to help
implement the database storage system on any worksheet application.
xxii
■ INTRODUCTION
xxiii
■ INTRODUCTION
• Functions: Excel worksheet functions appears in capital letters and are followed
by parenthesis: IF( ). When I list the arguments you can use with a function, they
will appear in a bullet list of items, using the same order that they appear inside the
function arguments list to explain the meaning of each one.
• Rows, columns, cell address, ranges, and sheet names: Excel rows, columns, cell
address, range names, and sheet names appear using an Arial font to detach them
from the text.
This book also uses the following box to call attention to important (or merely interesting) information:
■ Attention The Attention box presents asides that give you more information about the topic under
discussion. These tidbits provide extra insights that give you a better understanding of the task at hand, offer
complementary information about the issue that is being currently discussed, or even talk about an unexpected
Excel behavior regarding a given task.
xxiv
CHAPTER 1
This chapter will teach you how to program Microsoft Excel using Visual Basic for Applications code
procedures. It will show you how to interact with the VBA integrated development environment (IDE), show
how VBA programming code works, and give lots of examples. This introduction is for people who do not know
anything about VBA and want to get started. If you already have some experience, you can skip to Chapter 2.
You can obtain all the procedure code in this chapter by downloading the Chapter01.zip file
from the book’s page at Apress.com, located at www.apress.com/9781484222041, or from http://
ProgrammingExcelWithVBA.4shared.com.
Although you can consider Excel macro code to be any kind of code automation created to interact with
Excel and its environment, you can divide the code into two types of VBA code.
• Excel macros: The VBA code created by Excel itself when you activate Excel macro
recording and execute any successive actions on its interface
• VBA programming code: The code you create by hand to implement the same
automation, but with more control and many times with more efficiency
In this book I will teach you how to understand and create your own VBA code procedures so you can
take greater control of your worksheet applications.
Figure 1-1. This is the Excel Developer tab, where you will find, among other tools, the Visual Basic command
button to activate the Visual Basic IDE
2
CHAPTER 1 ■ UNDERSTANDING VISUAL BASIC FOR APPLICATIONS (VBA)
Figure 1-2. To show the Developer tab on the Excel ribbon, select File ➤ Options, click Customize Ribbon, and
check the Developer option in the right list box
Figure 1-3 shows the Visual Basic IDE that you can activate by pressing Alt+F11 or by clicking the Visual
Basic command on the Excel Developer tab.
■ Attention You can turn on the visibility of the Project Explorer, the Properties window, and the Immediate
window using the appropriate commands in the Visual Basic View menu item.
3
CHAPTER 1 ■ UNDERSTANDING VISUAL BASIC FOR APPLICATIONS (VBA)
Excel has the ability to open workbook files, which are a special kind of file made up of one or more
worksheets (called Sheet1, Sheet2, and Sheet3). Indeed, each new file created by Microsoft Office 2003
or later versions has by default three blank worksheets (although you can configure Excel to create new
workbooks with 1 to 100 blank worksheets).
■ Attention To configure the number of blank worksheets a new Excel workbook (or Excel file) has, select
File ➤ Option, select “Include this many sheets” option, and indicate how many worksheets you desire. Note,
however, that every workbook must have at least one worksheet inside it.
Figure 1-3. This is the Visual Basic IDE that you use to write and follow VBA procedures and codes, with the
Project Explorer, the Properties window, the Immediate window, and the Code window (for Book1, Sheet1)
visible
From VBA’s point of view, each Excel object has its own code module: one for the entire workbook (it is
the last object on the Microsoft Excel Objects branch of the Project Explorer tree, named ThisWorkbook) and
one for each worksheet inserted by default on the workbook, named with the same worksheet name (Sheet1
to Sheet3 on a default workbook with three blank worksheets). They are always positioned at the beginning
of the Microsoft Excel Objects branch of the Project Explorer tree (Figure 1-4).
4
CHAPTER 1 ■ UNDERSTANDING VISUAL BASIC FOR APPLICATIONS (VBA)
Figure 1-4. Every Excel file, or Excel workbook, has at least one code module associated with the workbook
(named ThisWorkbook) and one code module for each worksheet, having the same name of the sheet tab. They
are all shown on the Project Explorer tree
To see the VBA code module associated with each default Excel object, double-click the code
module in the Project Explorer tree. Figure 1-3 shows the Sheet1 code module, while Figure 1-5 shows the
ThisWorkbook code module opened in the VBA IDE.
Figure 1-5. This is the VBA code module associated with the Excel workbook file. By default it is called
ThisWorkbook, and every Excel file has just one of them
5
CHAPTER 1 ■ UNDERSTANDING VISUAL BASIC FOR APPLICATIONS (VBA)
Figure 1-6. This is the VBA IDE after a new independent code module called Module1 was created using the
VBA Insert ➤ Module menu command
■ Attention You can change the focus from one code module to another by double-clicking the Project
Explorer tree or by using VBA Windows menu command to select it from among any open code module windows.
Note that whenever you select any Excel object in the VBA Project Explorer tree, all its properties are
shown in the Properties window, even if the code module is closed. Later in this book I will talk about some
interesting code module properties associated with just the VBA IDE or with the object itself (properties
associated with the worksheet or workbook object).
This VBA structure of different code module windows is part of any Excel macro-enabled workbook,
even if you don’t use them! They are the documents that can be manipulated just by the VBA IDE, and it is
where all the action will occur to control the automation of your Excel solution.
6
CHAPTER 1 ■ UNDERSTANDING VISUAL BASIC FOR APPLICATIONS (VBA)
■ Attention To delete any module or class module inserted in the VBA structure of an Excel file, right-click
its name on the Project Explorer tree and select Remove <Module Name> in the pop-up menu. You will be
prompted to export the code module code before you delete it from the workbook structure.
Class Modules
Class modules are a special type of code module that allows the creation of a programmable “object.” Using
Class modules, you can trap other existing VBA objects (like the Excel Application object, UserForm, and
so on), create your own objects, define behavior using Property procedures and methods represented by
Public and Sub procedures, and raise events (automatically respond to user actions). Consider a Class
module as a code repository that can be reused, creating many instances of the class for the same purpose,
where all instances share the same base code. The Class module is the core module of object-oriented
programming in VBA, and you will see it in action later in this book.
7
CHAPTER 1 ■ UNDERSTANDING VISUAL BASIC FOR APPLICATIONS (VBA)
For our usage, let’s just stay with this simple definition: use a Function procedure whenever you want
to return a value, and use a Sub procedure whenever you want to execute any necessary and successive
programming steps without returning any value (and this Sub procedure eventually can be reused by other
procedures).
Both Function and Sub procedures have specific syntax rules for any VBA code module: a begin
statement that indicates its scope (Public or Private), its name, its argument list (if any), the type of
returned value for Function procedures, and an End statement.
The following VBA code fragment declares a simple Function procedure named FindFoodITem( )
(note that it has a return value declared as Boolean):
■ Attention In this book, everything that appears inside the < > characters means the name you must give
to the procedure or argument it represents.
The following is another VBA code fragment declaring a Sub procedure named FindFoodItem( ) (note
that it does not return a value):
Sub FindFoodItem( )
...
End Sub
■ Attention In the same VBA code module there can be only one FindFoodItem( ) procedure, declared as a
Function or Sub procedure.
The following is the complete VBA syntax necessary to declare a Function procedure (optional parts of
the Function declaration are between brackets):
In this code:
[Public | Private | Friend | Static]: These are VBA keywords to specify the
scope of the Function procedure. Note that they are between brackets, meaning
that they are optional. If you don’t use a VBA keyword, the Function will be
considered Private, meaning that it can be accessed only by the procedures
inside the code module where it belongs. If you use the keyword Public to
declare a Function procedure, it will be capable of being accessed from other
procedures in any other code module of your workbook application.
8
CHAPTER 1 ■ UNDERSTANDING VISUAL BASIC FOR APPLICATIONS (VBA)
■ Attention The Friend keyword is used only on Class modules to create procedures that are public to
all Excel objects on the same workbook while it is private to the code. The Static keyword indicates that all
variables declared inside the Function procedure will keep their values between function calls.
<FunctionName>: This is the name you want to associate with the Function
procedure. It must begin with a letter and have no spaces or reserved characters.
A good programming practice for Function names is to use a clear name that
indicates what it executes. It must be made up of concatenated names, where
each name must begin with a capital letter like Function FindFoodItem( ).
[Optional] [Arg1]: Both Function and Sub procedures must be followed by a
pair of parentheses, which may contain one or more declared arguments that the
function can receive. These arguments are the values upon which the function
will operate. VBA allows you to pass optional arguments if you precede them
with the Optional keyword (meaning that you are not obliged to pass them to the
procedure). Once one argument is declared as Optional, all others that follow it
must also be declared as Optional.
[As <Type>]: Arguments for Function and Sub procedures, as the values
returned by a Function procedure, can be of a specific type. They can be an
integer or real number, a text string, a date, a logical value, or an object. If you
do not specify the type expected to be received by an argument or returned by a
Function, the type will be considered as the Variant data type, which is a special
kind of VBA data that is polymorphic, meaning it can represent any data type.
End Function: This must be the last function statement indicating to VBA where
the code procedure ends.
To declare a Sub procedure, you use the following syntax. Note that it is almost identical to the Function
procedure declaration, except it doesn’t return a value (it doesn’t have the [As Type] part of the Function
declaration) and has an End Sub statement to indicate its finish.
9
CHAPTER 1 ■ UNDERSTANDING VISUAL BASIC FOR APPLICATIONS (VBA)
■ Attention You can easily get the number for any date by typing it in any Excel cell and changing the cell
format from Date to General number.
By subtracting two different valid dates, you will receive the number of days between the two dates.
Dividing this result by 365 days per year, you will get the difference in years, right?
■ Attention For your information, a valid Date value is one that has no more 30 days in April, June, September,
and November; has no more than 29 days in February on lap years (28 days in normal years); has no more than
31 days in January, March, May, July, August, October, and December; and has a month value between 1 and 12.
The next Function procedure code calculates any person’s age in years by receiving the person’s date of
birth as an argument to the procedure:
Function AgeInYears(DateOfBirth)
AgeInYears = (Date - DateOfBirth) / 365
End Function
■ Attention Extract the AgeInYears.xlsm macro-enabled workbook from the Chapter01.zip file to test this
function procedure.
10
Discovering Diverse Content Through
Random Scribd Documents
Ambuscadoes of Salvages. {MN}
The 16. of June we fell with the river Patowomek: feare being gone,
and our men recovered, we were all content to take some paines, to
know the name of that seven mile broad river: for thirtie myles
sayle, we could see no inhabitants: {MN} then we were conducted
by two Salvages up a little bayed creeke, towards Onawmanient,
where all the woods were layd with ambuscado's to the number of
three or foure thousand Salvages, so strangely paynted, grimed and
disguised, shouting, yelling and crying as so many spirits from hell
could not have shewed more terrible. Many bravado's they made,
but to appease their fury, our Captaine prepared with as seeming a
willingnesse (as they) to incounter them. But the grazing of our
bullets upon the water (many being shot on purpose they might see
them) with the Ecco of the woods so amazed them, as downe went
their bowes and arrowes; (and exchanging hostage) James Watkins
was sent six myles up the woods to their Kings habitation. We were
kindly used of those Salvages, of whom we understood, they were
commanded to betray us, by the direction of Powhatan, and he so
directed from the discontents at James towne, because our Captaine
did cause them stay in their country against their wills.
A trecherous project.
A myne like Antimony. {MN-1}
An aboundant plenty of fish. {MN-2}
The 24 of July, Captaine Smith set forward to finish the discovery with
twelve men: their names were
Gentlemen. [III.60.]
Souldiers.
The wind being contrary caused our stay two or three dayes at
Kecoughtan: the King feasted us with much mirth, his people were
perswaded we went purposely to be revenged of the Massawomeks. {MN-
1} In the evening we fired a few rackets, which flying in the ayre so
terrified the poore Salvages, they supposed nothing unpossible we
attempted; and desired to assist us. The first night we anchored at Stingray
Isle. The next day crossed Patawomeks river, and hasted to the river Bolus.
We went not much further before we might see the Bay to divide in two
heads, and arriving there we found it divided in foure, all which we
searched so farre as we could sayle them. {MN-2} Two of them we found
inhabited, but in crossing the Bay, we incountred 7 or 8 Canowes full of
Massawomeks, we seeing them prepare to assault us, left our Oares and
made way with our sayle to incounter them, yet were we but five with our
Captaine that could stand, for within 2 dayes after we left Kecoughtan, the
rest (being all of the last supply) were sicke almost to death, untill they
were seasoned to the Country. Having shut them under our Tarpawling, we
put their hats upon stickes by the Barges side, and betwixt two hats a man
with two peeces, to make us seeme many, and so we thinke the Indians
supposed those hats to be men, for they fled with all possible speed to the
shore, and there stayed, staring at the sayling of our barge till we anchored
right against them. Long it was ere we could draw them to come unto us. At
last they sent two of their company unarmed in a Canow, the rest all
followed to second them if neede required. These two being but each
presented with a bell, brought aboord all their fellowes, presenting our
Captaine with venison, beares flesh, fish, bowes, arrowes, clubs, targets,
and beares-skinnes. We understood them nothing at all, but by signes,
whereby they signified unto us they had beene at warres with the
Tockwoghes, the which they confirmed by showing us their greene wounds,
but the night parting us, we imagined they appointed the next morning to
meete, but after that we never saw them.
Our order was daily to have Prayer, with a Psalme, at which solemnitie
the poore Salvages much wondred, our Prayers being done, a while they
were busied with a consultation till they had contrived their businesse.
[III.61.] {MN} Then they began in a most passionate manner to hold up
their hands to the Sunne, with a most fearefull song, then embracing our
Captaine, they began to adore him in like manner: though he rebuked them,
yet they proceeded till their song was finished: which done with a most
strange furious action, and a hellish voyce, began an Oration of their loves;
that ended, with a great painted Beares skin they covered him: then one
ready with a great chayne of white Beads, weighing at least six or seaven
pound, hung it about his necke, the others had 18 mantels, made of divers
sorts of skinnes sowed together; all these with many other toyes they layd at
his feete, stroking their ceremonious hands about his necke for his Creation
to be their Governour and Protector, promising their aydes, victualls, or
what they had to be his, if he would stay with them, to defend and revenge
them of the Massawomeks. But we left them at Tockwhogh, sorrowing for
our departure, yet we promised the next yeare againe to visit them. Many
descriptions and discourses they made us, of Atquanachuck, Massawomek,
& other people, signifying they inhabit upon a great water beyond the
mountaines, which we understood to be some great lake, or the river of
Canada: and from the French to have their hatchets and Commodities by
trade. These know no more of the territories of Powhatan, then his name,
and he as little of them, but the Atquanachuks are on the Ocean Sea.
Pawtuxunt, R.
Thus having sought all the inlets and rivers worth noting, we returned
to discover the river of Pawtuxunt; these people we found very tractable,
and more civill then any, we promised them, as also the Patawomeks to
revenge them of the Massawomeks, but our purposes were crossed.
Rapahanock, R.
The exceeding love of the Salvage Mosco. {MN-1}
Our fight with the Rapahanocks. {MN-2}
Upon the alarum by that we had recovered our armes, there was about
an hundred nimble Indians skipping from tree to tree, letting fly their
arrows so fast as they could: the trees here served us for Baricadoes as well
as they. But Mosco did us more service then we expected, for having shot
away his quiver of Arrowes, he ran to the Boat for more. The Arrowes of
Mosco at the first made them pause upon the matter, thinking by his bruit
and skipping, there were many Salvages. About halfe an houre this
continued, then they all vanished as suddainly as they approached. Mosco
vanished as suddenly as they approached. Mosco followed them so farre as
he could see us, till they were out of sight. {MN-1} As we returned there
lay a Salvage as dead, shot in the knee, but taking him up we found he
[III.63] had life, which Mosco seeing, never was Dog more furious against
a Beare, then Mosco was to have beat out his braines, so we had him to our
Boat, where our Chirurgian who went with us to cure our Captaines hurt of
the Stingray, so dressed this Salvage that within an houre after he looked
somewhat chearefully, and did eate and speake. In the meane time we
contented Mosco in helping him to gather up their arrowes, which were an
armefull, whereof he gloried not a little. Then we desired Mosco to know
what he was, and what Countries were beyond the mountaines; the poore
Salvage mildly answered, he and all with him were of Hasinninga, where
there are three Kings more, like unto them, namely the King of Stegora, the
King of Tauxuntania, and the King of Shakahonea, that were come to
Mohaskahod, which is onely a hunting Towne, and the bounds betwixt the
Kingdome of the Mannahocks, and the Nandtaughtacunds, but hard by
where we were. We demanded why they came in that manner to betray us,
that came to them in peace, and to seeke their loves; he answered, they
heard we were a people come from under the world, to take their world
from them. {MN-2} We asked him how many worlds he did know, he
replyed, he knew no more but His relation of that which was under the skie
that covered him, which were the Powhatans, with the Monacans, and the
Massawomeks, that were higher up in the mountaines. Then we asked him
what was beyond the mountaines, he answered the Sunne: but of any thing
els he knew nothing; because the woods were not burnt. [FN] These and
many such questions wee demanded, concerning the Massawomeks, the
Monacans, their owne Country, and where were the Kings of Stegora,
Tauxsintania, and the rest. The Monacans he sayd were their neighbours
and friends, and did dwell as they in the hilly Countries by small rivers,
living upon rootes and fruits, but chiefly by hunting. The Massawomeks did
dwell upon a great water, and had many boats, & so many men that they
made warre with all the world. For their Kings, they were gone every one a
severall way with their men on hunting: But those with him came thither a
fishing till they saw us, notwithstanding they would be altogether at night at
Mahaskahod. For his relation we gave him many toyes, with perswasions to
goe with us, and he as earnestly desired us to stay the comming of those
Kings that for his good usage should be friends with us, for he was brother
to Hasinninga. But Mosco advised us presently to be gone, for they were all
naught, yet we told him we would not till it was night. All things we made
ready to entertain what came, & Mosco was as diligent in trimming his
arrowes. The night being come we all imbarked, for the river was so
narrow, had it beene light the land on the one side was so high, they might
have done us exceeding much mischiefe. All this while the K. of
Hasinninga was seeking the rest, and had consultation a good time what to
doe. But by their espies seeing we were gone, it was not long before we
heard their arrowes dropping on every side the Boat; we caused our
Salvages to call unto them, but such a yelling & hallowing they made that
they heard nothing, but now and then a peece, ayming so neare as we could
where we heard the most voyces. More then 12 myles they followed us in
this manner; then the day appearing, we found our selves in a broad Bay,
out of danger of their shot, where wee came to an anchor, and fell to
breakfast. Not so much as speaking to them till the Sunne was risen; being
well refreshed, we untyed our Targets that covered us as a Deck, and all
shewed our selves with those shields on our armes, and swords in our
hands, and also our prisoner Amoroleck; a long discourse there was betwixt
his Countrimen and him, how good wee were, how well wee used him, how
wee had a Patawomek with us, loved us as his life, that would have slain
him had we not preserved him, and that he should have his libertie would
they be but friends; and to doe us any hurt it was impossible. {MN-3} Upon
this they all hung their Bowes and Quivers upon the trees, and one came
swimming aboord us with a bow tyed on his head, and another with a
Quiver of Arrowes, which they delivered our Captaine as a present, the
Captaine having used them so kindly as he could, told them the other three
Kings should doe the like, and then the great King of our world should be
their friend, whose men we were. It was no sooner demanded but
performed, so upon a low Moorish poynt [III.64.] of Land we went to the
shore, where those foure Kings came and received Amoroleck: nothing they
had but Bowes, Arrowes, Tobacco-bags, and Pipes: what we desired, none
refused to give us, wondering at every thing we had, and heard we had
done: our Pistols they tooke for pipes, which they much desired, but we did
content them with other Commodities, and so we left foure or five hundred
of our merry Mannahocks, singing, dauncing, and making merry, and set
sayle for Moraughtacund.
In our returnes we visited all our friends, that rejoyced much at our
Victory against the Mannahocks, who many times had Warres also with
them, but now they were friends, and desired we would be friends with the
Rapahanocks, {MN-1} as we were with the Mannahocks. Our Captaine told
them, they had twise assaulted him that came onely in love to doe them
good, and therefore he would now burne all their houses, destroy their
corne, and for ever hold them his enemies, till they made him satisfaction;
they desired to know what that should be: he told them they should present
him the Kings Bow and Arrowes, and not offer to come armed where he
was; that they should be friends with the Moraughtacunds his friends, and
give him their Kings sonne in pledge to performe it, and then all King
James his men should be their friends. Upon this they presently sent to the
Rapahanocks to meete him at the place where they first fought, where
would be the Kings of Nantautacund and Pissassac: which according to
their promise were there so soone as we; where Rapahanock presented his
Bow and Arrowes, and confirmed all we desired, except his sonne, having
no more but him he could not live without him, but in stead of his sonne he
would give him the three women Moraughtacund had stolen. This was
accepted: and so in three or foure Canowes, so many as could went with us
to Moraughtacund, where Mosco made them such relations, and gave to his
friends so many Bowes and Arrowes, that they no lesse loved him then
admired us. The 3 women were brought our Captaine, to each he gave a
chayne of Beads: and then causing Moraughtacund, Mosco, and
Rapahanock stand before him, bid Rapahanock take her he loved best, and
Moraughtacund chuse next, & to Mosco he gave the third. Upon this away
went their Canowes over the water, to fetch their venison, and all the
provision they could, and they that wanted Boats swam over the river: the
darke commanded us then to rest. The next day there was of men, women,
and children, as we conjectured, six or seaven hundred, dauncing, &
singing, and not a Bow nor Arrow seene amongst them. Mosco changed his
name Uttasantasough, which we interpret Stranger, for so they call us. All
promising ever to be our friends, and to plant Corne purposely for us; and
we to provide hatchets, beads, and copper for them, we departed, giving
them a Volley of shot, and they us as loud shouts and cryes as their
strengths could utter. {MN-2} That night we anchored in the river of
Payankatank, and discovered it so high as it was navigable, but the people
were most a hunting, save a few old men, women, and children, that were
tending their corne, of which they promised us part when we would fetch it,
as had done all the Nations where ever we had yet beene.
A.D. 1608.
Chapter VII.
A Virginia Maske.
In a fayre plaine field they made a fire, before which, he sitting upon a
mat, suddainly amongst the woods was heard such a hydeous noise and
shreeking, that the English betooke themselves to their armes, and seized on
two or three old men by them, supposing Powhatan with all his power was
come to surprise them. But presently Pocahontas came, willing him to kill
her if any hurt were intended, and the beholders, which were men, women,
and children, satisfied the Captaine there was no such matter. Then
presently they were presented with this anticke; thirtie young women came
naked out of the woods, onely covered behind and before with a few greene
leaves, their bodies all painted, some of one colour, some of another, but all
differing, their leader had a fayre payre of Bucks hornes on her head, and an
Otters skinne at her girdle, and another at her arme, a quiver of arrowes at
her backe, a bow and arrowes in her hand; the next had in her hand a sword,
another a club, another a pot-sticke; all horned alike: the rest every one with
their severall devises. These fiends with most hellish shouts and cryes,
rushing from among the trees, cast themselves in a ring about the fire,
singing and dauncing with most excellent ill varietie, oft falling into their
infernall passions, and solemnly againe to sing and daunce; having spent
neare an houre in this Mascarado, as they entred in like manner they
departed.
Thus did they shew their feats of armes, and others art in dauncing:
Some other us'd there oaten pipe, and others voyces chanting.
The next day came Powhatan. Smith delivered his [III.68.] message of
the presents sent him, and redelivered him Namontack he had sent for
England, desiring him to come to his Father Newport, to accept those
presents, and conclude their revenge against the Monacans. Whereunto this
subtile Savage thus replyed.
Powhatans answer.
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
textbookfull.com