100% found this document useful (1 vote)
77 views56 pages

Programming Excel With VBA A Practical Real World Guide Flavio Morgado - Instantly Access The Full Ebook Content in Just A Few Seconds

The document promotes various eBooks available for download at textbookfull.com, focusing on programming with Excel VBA and other programming languages. It includes links to titles such as 'Programming Excel with VBA' by Flavio Morgado and 'Excel VBA Programming For Dummies' by Michael Alexander. The content also outlines the structure and chapters of the book, emphasizing practical applications and programming techniques.

Uploaded by

khatikndoki
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
100% found this document useful (1 vote)
77 views56 pages

Programming Excel With VBA A Practical Real World Guide Flavio Morgado - Instantly Access The Full Ebook Content in Just A Few Seconds

The document promotes various eBooks available for download at textbookfull.com, focusing on programming with Excel VBA and other programming languages. It includes links to titles such as 'Programming Excel with VBA' by Flavio Morgado and 'Excel VBA Programming For Dummies' by Michael Alexander. The content also outlines the structure and chapters of the book, emphasizing practical applications and programming techniques.

Uploaded by

khatikndoki
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 56

Explore the full ebook collection and download it now at textbookfull.

com

Programming Excel with VBA A Practical Real World


Guide Flavio Morgado

https://textbookfull.com/product/programming-excel-with-vba-
a-practical-real-world-guide-flavio-morgado/

OR CLICK HERE

DOWLOAD EBOOK

Browse and Get More Ebook Downloads Instantly at https://textbookfull.com


Click here to visit textbookfull.com and download textbook now
Your digital treasures (PDF, ePub, MOBI) await
Download instantly and pick your perfect format...

Read anywhere, anytime, on any device!

EXCEL VBA Programming By Examples Programming For Complete


Beginners Step By Step Illustrated Guide to Mastering
Excel VBA Thanh Tran
https://textbookfull.com/product/excel-vba-programming-by-examples-
programming-for-complete-beginners-step-by-step-illustrated-guide-to-
mastering-excel-vba-thanh-tran/
textbookfull.com

Excel VBA Programming For Dummies 5th Edition Michael


Alexander

https://textbookfull.com/product/excel-vba-programming-for-
dummies-5th-edition-michael-alexander/

textbookfull.com

Introducing Microsoft Access Using Macro Programming


Techniques An Introduction to Desktop Database Development
by Example 1st Edition Flavio Morgado
https://textbookfull.com/product/introducing-microsoft-access-using-
macro-programming-techniques-an-introduction-to-desktop-database-
development-by-example-1st-edition-flavio-morgado/
textbookfull.com

Engineering Analysis Modeling With Excel VBA Version 9 0


9th Edition Matthew E. Moran

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

VBA for Modelers Developing Decision Support Systems with


Microsoft Office Excel 5th Edition S. Christian Albright

https://textbookfull.com/product/vba-for-modelers-developing-decision-
support-systems-with-microsoft-office-excel-5th-edition-s-christian-
albright/
textbookfull.com

Learning Java An Introduction to Real World Programming


with Java 5th Edition Marc Loy

https://textbookfull.com/product/learning-java-an-introduction-to-
real-world-programming-with-java-5th-edition-marc-loy/

textbookfull.com

Python Network Programming Cookbook Practical solutions to


overcome real world networking challenges 2nd Edition
Pradeeban Kathiravelu
https://textbookfull.com/product/python-network-programming-cookbook-
practical-solutions-to-overcome-real-world-networking-challenges-2nd-
edition-pradeeban-kathiravelu/
textbookfull.com

Practical Natural Language Processing A Comprehensive


Guide to Building Real world Nlp Systems 1st Edition
Sowmya Vajjala
https://textbookfull.com/product/practical-natural-language-
processing-a-comprehensive-guide-to-building-real-world-nlp-
systems-1st-edition-sowmya-vajjala/
textbookfull.com
Programming
Excel with VBA
A Practical Real-World Guide

Flavio Morgado
Programming
Excel with VBA
A Practical Real-World Guide

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

About the Author .....................................................................................................xv


About the Technical Reviewer ...............................................................................xvii
Acknowledgments ..................................................................................................xix
Introduction ............................................................................................................xxi

■Chapter 1: Understanding Visual Basic for Applications (VBA) ............................. 1


■Chapter 2: Programming the Microsoft Excel Application Object ....................... 81
■Chapter 3: Programming the Microsoft Excel Workbook Object ....................... 149
■Chapter 4: Programming the Microsoft Excel Worksheet Object ...................... 185
■Chapter 5: Programming the Microsoft Excel Range Object ............................. 239
■Chapter 6: Special Range Object Properties and Methods ................................ 333
■Chapter 7: Using Excel as a Database Repository ............................................. 427
■Chapter 8: Creating and Setting a Worksheet Database Class .......................... 495
■Chapter 9: Exchanging Data Between Excel Applications ................................. 603
■Chapter 10: Using the Windows API .................................................................. 711
■Chapter 11: Producing a Personal Ribbon Using RibbonEditor.xlam ................. 761

Afterword.............................................................................................................. 779
Index ..................................................................................................................... 783

v
Contents

About the Author .....................................................................................................xv


About the Technical Reviewer ...............................................................................xvii
Acknowledgments ..................................................................................................xix
Introduction ............................................................................................................xxi

■Chapter 1: Understanding Visual Basic for Applications (VBA) ............................. 1


What Is Macro Code? ....................................................................................................... 1
The VBA Environment ....................................................................................................... 2
Modules: The VBA Documents .......................................................................................... 3
Standard and Class Modules .................................................................................................................. 6

The VBA Language ........................................................................................................... 7


Procedures: The VBA Code...................................................................................................................... 7
Using Function and Sub Procedures....................................................................................................... 7
Variable Declaration ............................................................................................................................. 18
Variable Scope and Lifetime ................................................................................................................. 27
Create a Flow Chart for the Algorithm of Complex Procedures ............................................................ 32
Comment Your Code! ............................................................................................................................ 36
Using Public Code Module Variables .................................................................................................... 38
Public Procedures and Variables Constitute the Module Interface ....................................................... 40
Using Enumerators ............................................................................................................................... 40
Passing Arguments by Reference or by Value ...................................................................................... 42

Using a Naming Convention ........................................................................................... 42


Using Property Procedures ............................................................................................. 46
Property Procedures Allow Greater Control of Private Variables .......................................................... 48

vii
■ CONTENTS

VBA Statements, Functions, and Instructions................................................................. 48


Using VBA Instructions.......................................................................................................................... 49

Using Event Procedures ................................................................................................. 54


Using Class Modules ...................................................................................................... 57
Declaring and Raising Events on Object Code Modules ....................................................................... 58

Using VBA UserForms ..................................................................................................... 59


The VBA Me Keyword............................................................................................................................ 64
Evoking a VBA Procedure from an Excel Worksheet ...................................................... 64
Two Special VBA Functions: MsgBox and InputBox ........................................................ 67
Using MsgBox( ) .................................................................................................................................... 67
Using InputBox...................................................................................................................................... 72

Dealing with VBA Errors ................................................................................................. 75


The On Error Resume Next Instruction ................................................................................................. 76
Setting an Error Trap ............................................................................................................................. 76

Protecting Your VBA Code ............................................................................................... 77


Conclusion ...................................................................................................................... 78
Summary ........................................................................................................................ 78
■Chapter 2: Programming the Microsoft Excel Application Object ....................... 81
The Microsoft Excel Object Model .................................................................................. 81
The Application Object.................................................................................................... 82
Using Application Properties to Control the Way the Excel Interface Behaves ..................................... 87
Using Application Methods to Show Excel File Dialogs ........................................................................ 88
Using Application Events to React to User Actions ............................................................................. 125

Chapter Summary ........................................................................................................ 147


■Chapter 3: Programming the Microsoft Excel Workbook Object ....................... 149
The Workbook Object ................................................................................................... 149
Using Workbook Object Events ........................................................................................................... 151
Setting Workbook Object References ................................................................................................. 164

Chapter Summary ........................................................................................................ 184

viii
■ CONTENTS

■Chapter 4: Programming the Microsoft Excel Worksheet Object ...................... 185


The Worksheet Object .................................................................................................. 185
Using Worksheet Object Events .......................................................................................................... 188
Referring to Worksheets ..................................................................................................................... 191
Using Worksheet Object Properties and Methods .............................................................................. 197

Chapter Summary ........................................................................................................ 237


■Chapter 5: Programming the Microsoft Excel Range Object ............................. 239
The Range Object ......................................................................................................... 239
Using the Application.Range Property .......................................................................... 243
Using Range Object Properties and Methods ............................................................... 245
Updating the UserForm Interface ....................................................................................................... 247
Resizing the Selected Range .............................................................................................................. 254
Changing the Range Reference .......................................................................................................... 257

Using the Names Collection ......................................................................................... 258


Hiding Named Ranges ........................................................................................................................ 260
Resizing Named Ranges ..................................................................................................................... 262

Using Name Object Properties and Methods ................................................................ 265


Recovering Name Object Properties ................................................................................................... 269
Adding a New Name Object ................................................................................................................ 278
Selecting Items in the lstNames ListBox ............................................................................................ 290
Editing an Existing Name Object ........................................................................................................ 306
Resizing an Existing Name Object ...................................................................................................... 317
Performing Multiple Name Properties Changes ................................................................................. 322
Changing the Name.RefersTo Property ............................................................................................... 326

Chapter Summary ........................................................................................................ 332


■Chapter 6: Special Range Object Properties and Methods ................................ 333
Defining a Range with VBA ........................................................................................... 333
Using the Range.End Property ............................................................................................................ 335
Using the Range.CurrentRegion Property ........................................................................................... 336
Moving Through a Range with VBA..................................................................................................... 336
Creating the USDA Range Name ......................................................................................................... 339

ix
■ CONTENTS

Sorting Range Names................................................................................................... 341


Using Cascading Data Validation List Cells .................................................................. 343
The USDA Food Composer.xlsm Worksheet Application ..................................................................... 345

Creating USDA Worksheet Range Names ..................................................................... 347


Finding the Last Worksheet Used Cell .......................................................................... 353
Finding the Last Worksheet Row/Column with Range.End ................................................................. 353
Finding the Last Worksheet Row/Column with Worksheet.UsedRange .............................................. 354
Warning: Range.End Method and Hidden Rows.................................................................................. 356

Finding Range Information ........................................................................................... 358


The Range.Find Method ...................................................................................................................... 359
The Range.AutoFilter Method ............................................................................................................. 379
Finding Food Items with the Range.Sort Method................................................................................ 396

Using frmSearchFoodItems.xlsm ................................................................................. 415


Showing Selected Food Item Common Measures .............................................................................. 417
Returning the Selected Food Item ...................................................................................................... 419
Researching for a Selected Food Item................................................................................................ 423

Chapter Summary ........................................................................................................ 425


■Chapter 7: Using Excel as a Database Repository ............................................. 427
The Worksheet Database Storage System ................................................................... 427
The BMI Companion Chart ............................................................................................ 428
The BMI Companion Chart_Database.xlsm Excel Application ...................................... 433
Parameterization of BMI Chart Data ................................................................................................... 438
Changing BMI Chart Data ................................................................................................................... 441
Saving the Last Selected Record ........................................................................................................ 444
Saving BMI Chart Data ........................................................................................................................ 444
Loading BMI Chart Data ...................................................................................................................... 470
Deleting BMI Chart Data ..................................................................................................................... 471
Associating Database Procedures to Worksheet Button Controls ...................................................... 477
Making Copies of the BMI Chart Worksheet ....................................................................................... 478

x
■ CONTENTS

The USDA Food Composer_Database.xlsm Excel Application ...................................... 479


Changing Database Constant Values .................................................................................................. 483
Saving Recipe Data............................................................................................................................. 484
Saving Recipe Nutritional Information in My_Recipes Range Name .................................................. 486
Deleting a Recipe Data ....................................................................................................................... 487
Things That Are Worth Being Mentioned............................................................................................. 488

Chapter Summary ........................................................................................................ 493


■Chapter 8: Creating and Setting a Worksheet Database Class .......................... 495
Creating a Database Class ........................................................................................... 495
Steps 1 and 2: Create the Database Class Module ............................................................................. 496
Step 3: Create an Object Variable to Capture Worksheet Events ........................................................ 497
Steps 4 and 5: Change Constant Names to Variable Declarations ...................................................... 498
Step 6: Save Database Properties as Range Names .......................................................................... 501
Step 7: Use the Class_Initialize( ) Event to Read Database Properties ............................................... 503
Referencing the clsDatabase Class .................................................................................................... 504

Improving the clsDatabase Class Interface .................................................................. 506


Improving the Object Model................................................................................................................ 507

Using the SheetDBEngine Class ................................................................................... 532


Producing Data Navigation Controls ................................................................................................... 536

Setting the Worksheet Database Class ........................................................................ 540


Implementing the Worksheet Database Wizard .................................................................................. 540
Using the SheetDBEngine Class and frmDBProperties ....................................................................... 601

Conclusion .................................................................................................................... 601


Chapter Summary ........................................................................................................ 601
■Chapter 9: Exchanging Data Between Excel Applications ................................. 603
Updating the USDA Worksheet ..................................................................................... 603
Using the USDA Food List Creator Application .................................................................................... 604
The USDA Worksheet Updating Method .............................................................................................. 606
Using the USDA Food Composer_SheetDBEnginebasUSDA.xlsm Application .................................... 607
Warning About USDA Worksheet Updates .......................................................................................... 620
Using the USDA Food Composer_SheetDBEnginefrmUSDA.xlsm Application .................................... 622

xi
■ CONTENTS

Managing Worksheet Application Data......................................................................... 641


The frmManageRecipes_Initialize( ) Event ......................................................................................... 643
Inserting Copies of the My Recipes Sheet Tab.................................................................................... 648
Selecting Desired Recipes .................................................................................................................. 653
Saving Recipe Nutritional Information in the My_Recipes Range Name ............................................ 655
Exporting and Importing Recipe Data ................................................................................................. 667
Deleting Recipes from This Workbook ................................................................................................ 699
Exporting/Importing Recipes with Database Copy/Paste Methods..................................................... 703

Conclusion .................................................................................................................... 709


Chapter Summary ........................................................................................................ 709
■Chapter 10: Using the Windows API .................................................................. 711
The Microsoft Windows API .......................................................................................... 711
Using Declare Statements ............................................................................................ 712
Constants Declaration ........................................................................................................................ 713

Window Handles........................................................................................................... 713


Class Instance Handle .................................................................................................. 714
Creating a Timer Class ................................................................................................. 714
The TimerProc( ) Procedure ................................................................................................................ 718
Using the Timer Class ......................................................................................................................... 718

UserForm Handle.......................................................................................................... 720


Setting Bit Values ......................................................................................................... 721
Animating the UserForm Window ................................................................................. 722
The Animate( ) Procedure ................................................................................................................... 724

Manipulating the UserForm Window ............................................................................ 729


The UserForm Title Bar ....................................................................................................................... 730
The Appearance( ) Procedure ............................................................................................................. 732
The UserForm Transparency ............................................................................................................... 737

xii
■ CONTENTS

Applying a Skin to a UserForm ..................................................................................... 743


Device Contexts .................................................................................................................................. 744
Changing the UserForm Shape Using Windows Regions .................................................................... 745
The Skin( ) Procedure ......................................................................................................................... 748
The frmSkin UserForm........................................................................................................................ 753
The USDA Food Composer_frmAbout.xlsm Application ...................................................................... 755

Conclusion .................................................................................................................... 758


Chapter Summary ........................................................................................................ 759
■Chapter 11: Producing a Personal Ribbon Using RibbonEditor.xlam ................. 761
How Personal Ribbon Information Is Stored................................................................. 762
Using RibbonEditor.xlam............................................................................................... 762
Adding Tabs, Groups, and Buttons Using the RibbonX Add-In ............................................................ 767
Removing the CustomUI.xml File from a Workbook Application ......................................................... 775
Producing a Nice Ribbon with RibbonEditor.xlam............................................................................... 776

Conclusion .................................................................................................................... 777


Chapter Summary ........................................................................................................ 777

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.

What’s in the Book


This book is divided into 11 chapters, each one approaching Excel VBA programming with a new
complexity. To get a big picture of what you will find inside it, here is a summary of each chapter:
• Chapter 1, “Understanding Visual Basic for Applications (VBA),” is intended to
show you the VBA metaphor, including how to use VBA integrated development
environment (IDE) and the VBA language structure. It is a basic chapter to show you
a first approach to VBA and a programming language.
• Chapter 2, “Programming the Microsoft Excel Application Object,” touches on
the first programmable object in the Microsoft Excel object model hierarchy: the
Application object, which represents the Microsoft Excel application window, with
some of its main properties, methods, and events. In this chapter, you will learn
about the FileDialog, GetOpenFileName, GetSaveAsFileName, and OnTime methods;
when the Application object events fire; and how to use a Class module to watch
and/or control whether a worksheet tab name can be changed, as a first approach to
producing VBA objects.

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

• Chapter 9, “Exchanging Data Between Excel Applications,” answers important


questions regarding how to programmatically update worksheet-based tables from
where the worksheet application gathers its data. It teaches how to update the USDA
worksheet to any version released by the ARS-USDA web page, using either a simple,
silent procedural approach or a UserForm that reacts to the updating process, finding
food item name inconsistencies between two releases of SRxx.accdb or SRxx.
mdb Microsoft Access database nutrient tables. You will be also presented with the
frmManage UserForm to allow mass operation on the worksheet database so you
can delete and save recipe nutrient data and export and import recipes, using VBA
automation.
• Chapter 10, “Using the Windows API,” takes your VBA knowledge gathered so
far in this book to the next level by teaching you how to understand and use the
Windows application programmable interface (API), based on dynamic linked
libraries (DLLs) and C++ procedures. The API can be declared and called from
within a VBA project. In this chapter, you will learn how to implement a Timer class
to create programmable timer objects and how to change the UserForm appearance
by removing its title bar; adding a resizable border and minimize, restore, and
maximize buttons; and adding transparency and creating a fade effect. You’ll also
learn how to animate a UserForm when it loads and how to apply a skin effect to
change the UserForm shape.
• Chapter 11, “Producing a Personal Ribbon Using RibbonEditor.xlam,” uses the
RibbonX VBA add-in developed by Andy Pope as free software to produce a
personalized ribbon with tools that interact with your worksheet application, giving
it a professional appearance.
• The afterword is a brief testimony of the path used to write this book, with my
insights about how I imagined it and created it step-by-step, with trial-and-error
experimentation as I learned the Excel object model.

This Book’s Special Features


Programming Excel 2016 with VBA was designed to give you all the information you need to understand how
to replicate a behavior, insert a formula, define an interface, and so on, without making you wade through
ponderous explanations and interminable background. To make your life easier, this book includes various
features and conventions to help you get the most of the book and Excel itself.
• Steps: Throughout the book each Excel task is enumerated in step-by-step
procedures.
• Commands: I used the following style for Excel commands: Conditional Formatting
button in Styles area on the Home tab of the ribbon (this mean you must click the
Conditional Formatting button that you find in the Styles group of the Home tab).
• Menus: To indicate that you click the File menu and then select Save, I use File ➤ Save.

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.

Web Site Extras


All the examples presented in this book are available at www.apress.com/9781484222041 as ZIP files for
each book chapter. In addition to the example workbooks or worksheet applications, I’ll post any updates,
corrections, and other useful information related to this book.

Your Feedback Is (Very) Important!


Before you continue reading, I would like to say that your opinion is important to me. I really don’t know
how many of you will write to me to give any feedback, but I hope I can answer everyone and, whenever
possible, resolve any questions or problems that arise. Since I have many other duties, sometimes it may take
a little while so I can answer you, but I promise to do my best. Please feel free to write to me at the following
e-mail: [email protected].

xxiv
CHAPTER 1

Understanding Visual Basic for


Applications (VBA)

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.

What Is Macro Code?


There was a time in computer usage that if you needed to accomplish a series of successive commands
in software, you could use the appropriate program syntax to type the menu commands to follow, one
command per row, and then make the program execute them, row by row. In the DOS age of the early 1980s,
the spreadsheet program called Lotus 123 called this method a macro, and since then, every time a program
tries to allow the user to implement such a resource to execute any desired number of successive menu
commands, the convention is to say that the program is following a macro code.
The first versions of Windows and all Microsoft Office applications (including Microsoft Excel) could
implement this sort of automation by recording successive series of actions performed on the interface using
the keyboard or the mouse.
Until 1994 when Microsoft Excel was on version 3.0, each Microsoft Office application had its own way to
store its macro codes, meaning that these codes were not interchangeable between Office applications. In other
words, Word has its own set of commands, PowerPoint had another set, and Excel had yet another one. At this
time you needed to be very specialized to read and understand each Microsoft Office application macro code.
Everything changed in 1995, when Microsoft released Microsoft Visual Basic 4; its IDE used the VBA
language and made it part of all Microsoft Office 6 applications. From this time on, all Microsoft Office
applications were capable of being programmed using a single language, allowing all applications to interact
with each other. Even though this code was produced with VBA as a true programming language, the term
macro code stuck to this sort of application automation and continues to be used today.

Electronic supplementary material The online version of this chapter (doi:10.1007/978-1-4842-2205-8_1)


contains supplementary material, which is available to authorized users.

© Flavio Morgado 2016 1


F. Morgado, Programming Excel with VBA, DOI 10.1007/978-1-4842-2205-8_1
CHAPTER 1 ■ UNDERSTANDING VISUAL BASIC FOR APPLICATIONS (VBA)

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.

The VBA Environment


Before you begin to learn the Visual Basic for Applications language, you must acquaint yourself with the
VBA IDE; this is the place where you can create and test the VBA code of any Microsoft Office application.
There are two ways to open the VBA IDE.
• By going to the Microsoft Excel Developer tab and then clicking the Visual Basic
button, as shown in Figure 1-1
• By pressing Alt+F11 in any Microsoft Office application
Figure 1-1 shows the Developer tab on the Excel ribbon with the Visual Basic command button.

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

To show the Excel Developer tab, follow these steps:


1. Click the Excel File tab and select Options to show the Excel Options dialog box.
2. Select the Customize Ribbon option.
3. In the right list box, check the Developer tab (Figure 1-2).
4. Click OK to close the Excel Options dialog box.

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.

Modules: The VBA Documents


VBA works this way on Office documents: each document created by any Microsoft Office application has
one specific VBA object attached to it called a code module. It is almost impossible to dissociate the object
from the code module, and if this happens (which is rare but possible), the file becomes corrupted and
unusable until you fix it by deleting the offending object.

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)

Standard and Class Modules


Although no Excel object can be dissociated from its code module, you can create independent code
modules that are not associated with any object using the VBA Insert ➤ Module and Insert ➤ Class Module
menu commands. Figure 1-6 shows that after you execute VBA Insert ➤ Module, a new Module branch of
independent code modules is created inside the Project Explorer tree, with the new Module1 code module
already selected in the VBA interface.

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.

The VBA Language


Like any other programming language, VBA executes individual statements one at a time from the first row
after the procedure declaration to the last row.
You should strive to write procedure code using VBA strict syntax rules with one statement per row. The
shorter the procedure code is (the fewer rows it has), the faster it executes and the easier it is to understand.
To know how to write VBA code, you must understand its syntax for variable declarations, its
instructions, and its functions.

Procedures: The VBA Code


Procedures are the heart of any programming language. They are responsible for executing the actions you
need to grant a given functionality to your application.
You use VBA code modules to write the procedures that must be executed; there are three types of
procedures:
• Function procedures: These can return a value when finishing execution.
• Sub procedures: These can’t return a value.
• Property procedures: These are a special pair of procedures with the same name that
can implement an object property.
For now we will stay with the concept of Function and Sub procedures. Property procedures will be
addressed later in this chapter.

Using Function and Sub Procedures


You may ask why Function and Sub procedures exist, and my answer is that they are a holdover from the
very first programming language. They allow a programmer to divide the executing code into reusable parts.
The main code is executed by one procedure (Function or Sub), while any reusable can is executed by a Sub
procedure, thus reusing its code.

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):

Function FindFoodItem( ) as Boolean


[Statements]
FindFoodItem = <FunctionResult>
End Function

■ 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):

[Public | Private | Friend | Static] Function <FunctionName> ([Optional] [Arg1[ [as


Type],...) [As<Type>]
[Statements]
<FunctionName> = <FunctionResult>
End Function

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.

[Public, Private] Sub <SubName> ([Optional] [Arg1[ [as Type],…)


[Statements]
End Sub

Calculating Age in Years


Let’s try to write a simple VBA procedure to calculate the age in years of any person. How we can do that?
We need simple basic information: the person’s date of birth! Since your computer always has the
current date, we can use it to count the number of days between these two dates (current date minus date of
birth) and do some math to express the result in years.
Before we try to create this simple procedure, you need to know a basic concept regarding how VBA
treats date values.
To Windows—and all its applications—any date is just a consecutive counting of the number of days
since 01/01/1900. The first day of the 20th century is considered as day 1, and any later date is a consecutive
day counting from it (earlier dates are negative values). I am writing these words on 02/17/2014, and this
date is considered by Windows as day 41,687, meaning that it has been 41,687 days since January, 1, 1900.

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.

To build this AgeInYears function, follow these steps:


1. In the VBA interface of any Excel worksheet, choose the Insert ➤ Module menu
command to create a new standard code module.
2. Make the VBA Properties window visible by executing the View ➤ Properties
Window menu command.
3. In the Property window, type basAgeInYears for the Name property of this new
code module.
4. Insert in the basAgeInYears code module a new Public Function procedure by
executing the Insert ➤ Procedure menu command. In the Add Procedure dialog
box, type AgeInYears as the procedure name and select Function on Type and
Public on Scope.
5. Click OK to create the Function AgeInYears( ) procedure structure in the
basAgeInYear module (Figure 1-7).

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 like incounters we found at Patowomek Cecocawonee and divers


other places: but at Moyaones, Nacotchtant and Toags the people did their
best to content us. Having gone so high as we could with the bote, we met
divers Salvages in Canowes, well loaden with the flesh of Beares, Deere
and other beasts, whereof we had part, here we found mighty Rocks,
growing in some places above the grownd as high as the shrubby trees, and
divers other solid quarries of divers tinctures: and divers places where the
waters had falne from the high mountaines they had left a tinctured
spangled skurfe, that made many bare places seeme as guilded. Digging the
grownde above in the highest cliffs of rocks, we saw it was a claie sand so
mingled with yeallow spangles as if it had beene halfe pin-dust. In our
returne inquiring still for this Matchqueon, the king of Patawomeke gave us
guides to conduct us up a little river called Quiyough, up which we rowed
so high as we could. Leaving the bote, with six shot, and divers Salvages,
he marched seven or eight myle before they came to the mine: leading his
hostages in a small chaine they were to have for their paines, being proud so
richly to be adorned. {MN-1} The mine is a great Rocky mountaine like
Antimony; wherein they digged a great hole with shells & hatchets: and
hard by it, runneth a fayre brooke of Christal-like water, where they wash
away the drosse and keepe the remainder, which they put in little baggs and
sell it all over the country to paint there bodyes, faces, or Idols; which
makes them looke like Blackmores dusted over with silver. With so much as
we could carry we returned to our bote, kindly requiting this kinde king and
all his kinde people. The cause of this discovery was to search this mine, of
which Newport did assure us that those small baggs (we had given him) in
England he had tryed to hold halfe silver; but all we got proved of no value:
also to search what furrs, the best whereof is at Cuscarawaoke, where is
made so much Rawranoke or white beads that occasion as much dissention
among the Salvages, as gold and silver amongst Christians; and what other
mineralls, rivers, rocks, nations, woods, fishings, fruites, victuall, and what
other commodities the land afforded: and whether the bay were endlesse or
how farre it extended: of mines we were all ignorant, but a few Bevers,
Otters, Beares, Martins and minkes we found, {MN-2} and in divers places
that aboundance of fish, lying so thicke with their heads above the water, as
for want of nets (our barge driving amongst them) we attempted to catch
them with a frying pan: but we found it a bad instrument to catch fish with:
neither better fish, more plenty, nor more variety for smal fish, had any of
us ever seene in any place so swimming in the water, but they are not to be
caught with frying pans: some small codd also we did see swim close by the
shore by Smiths Iles, and some as high as Riccards Clifts. And some we
have found dead upon the shore.

How to deale with the Salvages.


Captaine Smith neare killed with a Stingray. {MN}

To express all our quarrels, trecheries and encounters amongst those


Salvages I should be too tedious: but in breefe, at all times we so incountred
them, and curbed their insolencies, that they concluded with presents to
purchase peace; yet we lost not a man: at our first meeting our Captaine
ever observed this order to demand their bowes and arrowes, swordes,
mantells and furrs, with some childe or two for hostage, whereby we could
quickly perceive, when they intended any villany. Having finished this
discovery (though our victuall was neere spent) he intended to see his
imprisonment-acquaintances [III.59.] upon the river of Rapahanock, by
many called Toppahanock, but our bote by reason of the ebbe, chansing to
grownd upon a many shoules lying in the entrances, we spyed many fishes
lurking in the reedes: our Captaine sporting himselfe by nayling them to the
grownd with his sword, set us all a fishing in that manner: thus we tooke
more in one houre then we could eate in a day. {MN} But it chansed our
Captaine taking a fish from his sword (not knowing her condition) being
much of the fashion of a Thornback, but a long tayle like a ryding rodde,
whereon the middest is a most poysoned sting, of two or three inches long,
bearded like a saw on each side, which she strucke into the wrest of his
arme neere an inch and a halfe: no bloud nor wound was seene, but a little
blew spot, but the torment was instantly so extreame, that in foure houres
had so swolen his hand, arme and shoulder, we all with much sorrow
concluded his funerall, and prepared his grave in an Island by, as himselfe
directed: yet it pleased God by a precious oyle Docter Russell at the first
applyed to it when he sounded it with probe (ere night) his tormenting paine
was so well asswaged that he eate of the fish to his supper, which gave no
lesse joy and content to us then ease to himselfe, for which we called the
Island Stingray Isle after the name of the fish.

The Salvages affrightened with their owne suspition. {MN-1}


Needlesse misery at James towne. {MN-2}

Having neither Chirurgian, nor Chirurgery, but that preservative oyle


we presently set sayles for James towne, passing the mouthes of the rivers
of Payankatank, & Pamaunkee, the next day we safely arrived at
Kecougtan. {MN-1} The simple Salvages seeing our Captaine hurt, and an
other bloudy by breaking his shinne, our numbers of bowes, arrowes,
swords, mantles, and furrs, would needes imagine we had beene at warres
(the truth of these accidents would not satisfie them) but impatiently
importuned us to know with whom. Finding their aptnesse to beleeve we
fayled not (as a great secret) to tell them any thing that might affright them,
what spoyle we had got and made of the Massawomeks. This rumor went
faster up the river then our Barge, that arrived at Waraskoyack the 20 of
July; where trimming her with painted streamers, and such devises as we
could, we made them at James towne jealous of a Spanish Frigot, where we
all God be thanked safely arrived the 21 of July. {MN-2} There we found
the last Supply were all sicke, the rest some lame, some bruised, all unable
to doe any thing but complaine of the pride and unreasonable needlesse
crueltie of the silly President, that had riotously consumed the store: and to
fulfill his follies about building him an unnecessary building for his
pleasure in the woods, had brought them all to that misery; that had we not
arrived, they had as strangely tormented him with revenge: but the good
newes of our Discovery, and the good hope we had by the Salvages relation,
that our Bay had stretched into the South Sea, or somewhat neare it,
appeased their fury; but conditionally that Ratliffe should be deposed, and
that Captaine Smith would take upon him the government, as by course it
did belong. Their request being effected, he substituted Mr. Scrivener his
deare friend in the Presidency, equally distributing those private provisions
the other had ingrossed, appointing more honest officers to assist master
Scrivener (who then lay exceeding sicke of a Callenture) and in regard of
the weaknesse of the company, and heate of the yeare, they being unable to
worke, he left them to live at ease, to recover their healths, but imbarked
himselfe to finish his Discovery.

Written by Walter Russell, Anas Todkill, and Thomas Momford.


Chap. VI.

The Government surrendred to Master Scrivener.

What happened the second Voyage in


discovering the Bay.

The 24 of July, Captaine Smith set forward to finish the discovery with
twelve men: their names were

Gentlemen. [III.60.]

Nathaniell Powell. Michell Sicklemore.


Thomas Momford. James Bourne.
Richard Fetherston. Anthony Bagnall, Chir.

Souldiers.

Jonas Profit. Richard Keale.


Anas Todkill. James Watkins.
Edward Pising. William Ward.

The Salvages admire fireworks. {MN-1}


An Incounter with Massawomeks at the head of the Bay. {MN-2}

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.

An Incounter with the Tockwoghs.

Entring the river of Tockwogh, the Salvages all armed, in a fleete of


boats, after their barbarous manner, round invironed us; so it chanced one of
them could speake the language of Powhatan, who perswaded the rest to a
friendly parley. But when they saw us furnished with the Massawomeks
weapons, and we faining the invention of Kecoughtan, to have taken them
perforce; they conducted us to their pallizadoed towne, mantelled with the
barkes of trees, with scaffolds like mounts, brested about with brests very
formally. Their men, women, and children with daunces, songs, fruits,
furres, and what they had, kindly welcommed us, spreading mats for us to
sit on, stretching their best abilities to expresse their loves.

Hatchets from the Sasquesahanocks.

Many hatchets, knives, peeces of iron, and brasse, we saw amongst


them, which they reported to have from the Sasquesahanocks, a mightie
people and mortall enemies with the Massawomeks. The Sasquesahanocks
inhabit upon the chiefe Spring of these foure branches of the Bayes head,
two dayes journey higher then our barge could passe for rocks, yet we
prevailed with the Interpreter to take with him another Interpreter, to
perswade the Sasquesahanocks to come visit us, for their language are
different. Three or foure dayes we expected their returne, then sixtie of
those gyant-like people came downe, with presents of Venison, Tobacco-
pipes three foot in length, Baskets, Targets, Bowes and Arrowes. Five of
their chiefe Werowances came boldly aboord us to crosse the Bay for
Tockwhogh, leaving their men and Canowes; the wind being so high they
durst not passe.

The Sasquesahanocks offer to the English. {MN}

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.

The highest mountaine we saw Northward wee called Perigrines


mount, and a rocky river, where the Massawomeks went up, Willowbyes
river, in honor of the towne our Captaine was borne in, and that honorable
house the Lord Willowby, his most honored good friend. The
Sasquesahanocks river we called Smiths falles; the next poynt to
Tockwhogh, Pisings poynt; the next it poynt Bourne. Powells Isles and
Smals poynt is by the river Bolus; and the little Bay at the head Profits
poole; Watkins, Reads, and Momfords poynts are on each side Limbo;
Ward, Cantrell, and Sicklemore, betwixt Patawomek and Pamaunkee, after
the names of the discoverers. In all those places and the furthest we came
up the rivers, we cut in trees so many crosses as we would, and in many
places made holes in trees, wherein we writ notes, and in some places
crosses of brasse, to signifie to any, English-men had beene there.

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}

In the discovery of this river some call Rapahanock, we were kindly


entertained by the people of Moraughtacund; here we incountered our old
friend Mosco, a lusty Salvage of Wighcocomoco upon the river of
Patawomek, we supposed him some French mans sonne, because he had a
thicke blacke bush beard, and the Salvages seldome have any at all, of
which he was not a little proud, to see so many of his Countrymen. {MN-1}
Wood and water he would fetch us, guide us any whether, cause divers of
his Countrymen helpe us towe against winde or tyde from place to place till
we came to Patawomek: there he rested till we returned from the head of
the river, and occasioned our conduct to the mine we supposed Antimony.
And in the place he fayled not to doe us all the good he could, perswading
us in any case not to goe to the Rapahanocks, for they would kill us for
being friends with the Moraughtacunds that but lately had stolne three of
the Kings women. This we did thinke was but that his friends might onely
have our trade: so we crossed the river to the Rapahanocks. {MN-2} There
some 12 or 16 standing on the shore, directed us a little Creeke where was
good landing, and Commodities for us in three or foure Canowes we saw lie
there: but according to our custome, we demanded to exchange a man in
signe of love, which after they had a little consulted, foure or five came up
to the middles, to fetch our man, and leave us one of them, shewing we
need not feare them, for they had neither clubs, bowes, nor arrowes.
Notwithstanding, Anas Todkill, being sent on shore to see if he could
discover any Ambuscadoes, or what they had, desired to goe over the
playne to fetch some wood, but they were unwilling, except we would come
into the Creeke, where the boat might come close ashore. Todkill by
degrees [III.62.] having got some two stones throwes up the playne,
perceived two or three hundred men (as he thought) behind the trees, so that
offering to returne to the Boat, the Salvages assayed to carry him away
perforce, that he called to us we were betrayed, and by that he had spoke the
word, our hostage was over-boord, but Watkins his keeper slew him in the
water. Immediatly we let fly amongst them, so that they fled, & Todkill
escaped, yet they shot so fast that he fell flat on the ground ere he could
recover the boat. Here the Massawomek Targets stood us in good stead, for
upon Mosco's words, we had set them about the forepart of our Boat like a
forecastle, from whence we securely beat the Salvages from off the plaine
without any hurt: yet they shot more then a thousand Arrowes, and then fled
into the woods. Arming our selves with these light Targets (which are made
of little small sticks woven betwixt strings of their hempe and silke grasse,
as is our Cloth, but so firmely that no arrow can possibly pierce them:) we
rescued Todkill, who was all bloudy by some of them who were shot by us
that held him, but as God pleased he had no hurt; and following them up to
the woods, we found some slaine, and in divers places much bloud. It seems
all their arrowes were spent, for we heard no more of them. Their Canows
we tooke; the arrowes we found we broke, save them we kept for Mosco, to
whom we gave the Canowes for his kindnesse, that entertained us in the
best triumphing manner, and warlike order in armes of conquest he could
procure of the Moraughtacunds.

The Salvages disguised like bushes fight. {MN}

The rest of the day we spent in accomodating our Boat, in stead of


thoules wee made stickes like Bedstaves, to which we fastened so many of
our Massawomek Targets, that invironed her as wast clothes. The next
morning we went up the river, and our friend Mosco followed us along the
shore, and at last desired to goe with us in our Boat. But as we passed by
Pisacack, Matchopeak, and Mecuppom, three Townes situated upon high
white clay clifts; the other side all a low playne marish, and the river there
but narrow. {MN} Thirtie or fortie of the Rapahanocks, had so
accommodated themselves with branches, as we tooke them for little bushes
growing among the sedge, still seeing their arrowes strike the Targets, and
dropped in the river: whereat Mosco fell flat in the Boat on his face, crying
the Rapahanocks, which presently we espied to be the bushes, which at our
first volley fell downe in the sedge: when wee were neare halfe a myle from
them, they shewed themselves dauncing and singing very merrily.

The Kings of Pissassack, Nandtaughtacund, and Cuttatawomen, used


us kindly, and all their people neglected not any thing to Mosco to bring us
to them. Betwixt Secobeck and Massawteck is a small Isle or two, which
causeth the river to be broader then ordinary; there it pleased God to take
one of our Company called Mr. Fetherstone, that all the time he had beene
in this Country, had behaved himselfe, honestly, valiantly, and industriously,
where in a little Bay, we called Fetherstones Bay wee buryed him with a
volley of shot: the rest notwithstanding their ill dyet, and bad lodging,
crowded in so small a Barge, in so many dangers never resting, but alwayes
tossed to and againe, had all well recovered their healths. The next day wee
sayled so high as our Boat would float, there setting up crosses, and graving
our names in the trees. Our sentinell saw an arrow fall by him, though we
had ranged up and downe more then an houre in digging in the earth,
looking of stones, herbs, and springs, not seeing where a Salvage could well
hide himself.

Our fight with the Mannahocks.


A Salvage shot and taken prisoner. {MN-1}
His relation of their countries. {MN-2}
They cannot travell but where the woods are burnt. [FN]
How we concluded peace with the foure kings of Monahoke. {MN-3}

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.

How we became friends with the Rapahanocks. {MN-1}


The discovery of Payankatank. {MN-2}

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.

In a fayre calme, rowing towards poynt Comfort, we anchored in


Gosnolls Bay, but such a suddaine gust surprised us in the night with
thunder and rayne, that we never thought more to have seene James Towne.
Yet running before the wind, we sometimes saw the Land by the flashes of
fire from heaven, by which light onely we kept from the splitting shore,
untill it pleased God in that blacke darknesse to preserve us by that light to
finde poynt Comfort: there refreshing our selves, because we had onely but
heard of the Chisapeacks & Nandsamunds, we thought it as fit to know all
our neighbours neare home, as so many Nations abroad.

A notable trechery of the Nandsamunds.


The fight with the Chisapeacks and Nandsamunds. {MN-1}
How they became friends. {MN-2}
The proceeding at James towne. {MN-3}
So setting sayle for the Southerne shore, we sayled up a narrow river
up the country of Chisapeack; it hath a good channell, but many shoules
about the entrance. By that we had sayled six or seaven myles, we saw two
or three little garden plots with their houses, the shore over-growne with the
greatest Pyne and Firre trees wee ever saw in the Country. But not seeing
nor hearing any people, and the river very narrow, we returned to the great
river, to see if we could finde any of them. Coasting the shore towards
Nandsamund, which is most Oyster-bankes; [III.65] at the mouth of that
river, we espied six or seaven Salvages making their wires, who presently
fled: ashore we went, and where they wrought we threw divers toyes, and
so departed. Farre we were not gone ere they came againe, and began to
sing, and daunce, and recall us: and thus we began our first acquaintance.
At last one of them desired us to goe to his house up that river, into our
Boat voluntarily he came, the rest ran after us by the shore with all shew of
love that could be. Seaven or eight myles we sayled up this narrow river: at
last on the Westerne shore we saw large Cornefields, in the midst a little
Isle, and in it was abundance of Corne; the people he told us were all a
hunting, but in the Isle was his house, to which he invited us with much
kindnesse: to him, his wife, and children, we gave such things as they
seemed much contented them. The others being come, desired us also to
goe but a little higher to see their houses: here our host left us, the rest
rowed by us in a Canow, till we were so far past the Isle the river became
very narrow. Here we desired some of them to come abord us, wherat
pausing a little, they told us they would but fetch their bows and arrowes
and goe all with us, but being a-shore and thus armed, they perswaded us to
goe forward, but we could neither perswade them into their Canow, nor into
our Boat. This gave us cause to provide for the worst. Farre we went not ere
seaven or eight Canowes full of men armed appeared following us, staying
to see the conclusion. {MN-1} Presently from each side the river came
arrowes so fast as two or three hundred could shoot them, whereat we
returned to get the open. They in the Canowes let fly also as fast, but
amongst them we bestowed so many shot, the most of them leaped
overboord and swam ashore, but two or three escaped by rowing, being
against their playnes: our Muskets they found shot further then their Bowes,
for wee made not twentie shot ere they all retyred behind the next trees.
Being thus got out of their trap, we seised on all their Canowes, and moored
them in the midst of the open. More then an hundred arrowes stucke in our
Targets, and about the boat, yet none hurt, onely Anthony Bagnall was shot
in his Hat, and another in his sleeve. But seeing their multitudes, and
suspecting as it was, that both the Nandsamunds, and the Chisapeacks were
together, we thought it best to ryde by their Canowes a while, to bethinke if
it were better to burne all in the Isle, or draw them to composition, till we
were provided to take all they had, which was sufficient to feed all our
Colony: but to burne the Isle at night it was concluded. {MN-2} In the
interim we began to cut in peeces their Canowes, and they presently to lay
downe their bowes, making signes of peace: peace we told them we would
accept, would they bring us their Kings bowes and arrowes, with a chayne
of pearle; and when we came againe give us foure hundred baskets full of
Corne, otherwise we would breake all their boats, and burne their houses,
and corne, and all they had. To performe all this they alledged onely the
want of a Canow; so we put one a drift & bad them swim to fetch her: and
till they performed their promise, wee would but onely breake their
Canowes. They cryed to us to doe no more, all should be as we would:
which presently they performed, away went their bowes and arrowes, and
tagge and ragge came with their baskets: so much as we could carry we
tooke, and so departing good friends, we returned to James Towne, where
we safely arrived the 7. of September, 1608. {MN-3} There we found Mr.
Scrivener, and divers others well recovered: many dead; some sicke: the
late President prisoner for mutiny: by the honest diligence of Master
Scrivener, the harvest gathered, but the provision in the store much spoyled
with rayne. Thus was that summer (when little wanted) consumed and
spent, and nothing done (such was the government of Captaine Ratliffe) but
onely this discovery; wherein to expresse all the dangers, accidents, and
incounters this small number passed in that small Barge, by the scale of
proportion, about three thousand myles, with such watery dyet in those
great waters and barbarous Countries (till then to any Christian utterly
unknowne) I rather referre their merit to the censure of the courteous and
experienced Reader, then I would be tedious or partiall being a partie.

But to this place to come who will adventure, [III.66.]


With judgements guide and reason how to enter:
Finds in this worlds broad sea, with winde and tyde,
Ther's safer sayle then any where besides.
But 'cause to wanton novices it is
A Province full of fearefulnesse I wiss;
Into the great vast deepe to venter out:
Those shallow rivers let them coast about.
And by a small Boat learne their first, and marke,
How they may come to make a greater Barke.

Written by Anthony Bagnall, Nathanaell


Powell, and Anas Todkill.

A.D. 1608.
Chapter VII.

The Presidency surrendred to Captaine Smith:


the Arrivall and returne of the second Supply.
And what happened.

Powhatans scorne when his courtesie was most deserved. {MN-1}


No better way to overthrow the business then by our instructors. {MN-2}
A consultation, where all the Councell was against the President. {MN-3}
Capt. Smith goeth with 4. to Powhatan, when Newport feared with 120.
{MN-4}

The tenth of September, by the Election of the Councell, and request of


the Company, Captaine Smith received the Letters Patents: which till then
by no meanes he would accept, though he was often importuned thereunto.
Now the building of Ratliffes Pallace stayed as a thing needlesse; the
Church was repaired; the Store-house recovered; buildings prepared for the
Supplyes we expected; the Fort reduced to a five-square forme; the order of
the Watch renewed; the squadrons (each setting of the Watch) trained; the
whole Company every Saturday exercised, in the plaine by the west
Bulwarke, prepared for that purpose, we called Smithfield: where
sometimes more then an hundred Salvages would stand in an amazement to
behold, how a fyle would batter a tree, where he would make them a marke
to shoot at; the boats trimmed for trade, which being sent out with
Lieutenant Percy, in their Journey incountred the second Supply, that
brought them backe to discover the Country of Monacan. How or why
Captaine Newport obtained such a private Commission, as not to returne
without a lumpe of gold, a certaintie of the South sea, or one of the lost
company sent out by Sir Walter Raleigh, I know not; nor why he brought
such a five peeced Barge, not to beare us to that South sea, till we had borne
her over the mountaines, which how farre they extend is yet unknowne.
{MN-1} As for the Coronation of Powhatan, and his presents of Bason and
Ewer, Bed, Bedstead, Clothes, and such costly novelties, they had beene
much better well spared then so ill spent, for wee had his favour much
better onely for a playne peece of Copper, till this stately kinde of soliciting,
made him so much overvalue himselfe, that he respected us as much as
nothing at all. As for the hyring of the Poles and Dutch-men, to make Pitch,
Tar, Glasse, Milles, and Sope ashes, when the Country is replenished with
people, and necessaries, would have done well, but to send them and
seaventie more without victualls to worke, was not so well advised nor
considered of, as it should have beene. Yet this could not have hurt us had
they beene 200. though then we were 130 that wanted for our selves. For
we had the Salvages in that decorum (their harvest being newly gathered,)
that we feared not to get victuals for 500. {MN-2} Now was there no way
to make us miserable, but to neglect that time to make provision whilst it
was to be had, the which was done by the direction from England to
performe this strange discovery, but a more strange Coronation to loose that
time, spend that victualls we had, tyre and starve our men, having no
meanes to carry victuals, munition, the hurt or sicke, but on their owne
backes. How or by whom they were invented I know not: but Captaine
Newport we onely accounted the Author, who to effect these projects, had
so guilded mens hopes with great promises, that both Company and
Councell concluded his resolution for the most part: God doth know they
little [III.67.] knew what they did, nor understood their owne estates to
conclude his conclusions, against all the inconveniences the foreseeing
President alledged. {MN-3} Of this Supply there was added to the
Councell, one Captaine Richard Waldo, and Captaine Wynne, two auncient
Souldiers, and valiant Gentlemen, but yet ignorant of the busines, (being
but newly arrived.) Ratliffe was also permitted to have his voyce, & Mr.
Scrivener, desirous to see strange Countries: so that although Smith was
President, yet the Major part of the Councell had the authoritie and ruled it
as they listed. As for clearing Smiths objections, how Pitch and Tarre,
Wainscot, Clapbord, Glasse, and Sope ashes, could be provided, to relade
the ship, or provision got to live withall, when none was in the Country, and
that we had, spent, before the ship departed to effect these projects. The
answer was, Captaine Newport undertooke to fraught the Pinnace of twentie
tunnes with Corne in going and returning in his Discovery, and to refraught
her againe from Werowocomoco of Powhatan. Also promising a great
proportion of victualls from the Ship; inferring that Smiths propositions
were onely devices to hinder his journey, to effect it himselfe; and that the
crueltie he had used to the Salvages, might well be the occasion to hinder
these Designes, and seeke revenge on him. For which taxation all workes
were left, and 120 chosen men were appointed for Newports guard in this
Discovery. But Captaine Smith to make cleare all those seeming suspitions,
that the Salvages were not so desperate as was pretended by Captaine
Newport, and how willing (since by their authoritie they would have it so)
he was to assist them what he could, because the Coronation would
consume much time, he undertooke himselfe their message to Powhatan, to
intreat him to come to James Towne to receive his presents. {MN-4} And
where Newport durst not goe with lesse then 120. he onely tooke with him
Captaine Waldo, Mr. Andrew Buckler, Edward Brendon, and Samuel
Collier: with these foure he went over land to Werowocomoco, some 12
myles; there he passed the river of Pamaunkee in a Salvage Canow.
Powhatan being 30 myles of, was presently sent for: in the meane time,
Pocahontas and her women entertained Captaine Smith in this manner.

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.

The womens entertainment.

Having reaccommodated themselves, they solemnly invited him to


their lodgings, where he was no sooner within the house, but all these
Nymphes more tormented him then ever, with crowding, pressing, and
hanging about him, most tediously crying, Love you not me? love you not
me? This salutation ended, the feast was set, consisting of all the Salvage
dainties they could devise: some attending, others singing and dauncing
about them; which mirth being ended, with fire-brands in stead of Torches
they conducted him to his lodging.

Thus did they shew their feats of armes, and others art in dauncing:
Some other us'd there oaten pipe, and others voyces chanting.

Captaine Smiths message.

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.

If your King have sent me Presents, I also am a King, and this is my


land: eight dayes I will stay to receive them. Your Father is to come to me,
not I to him, nor yet to your Fort, neither will I bite at such a bait: as for the
Monacans I can revenge my owne injuries, and as for Atquanachuk, where
you say your brother was slaine, it is a contrary way from those parts you
suppose it; but for any salt water beyond the mountaines, the Relations you
have had from my people are false. Whereupon he began to draw plots upon
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade

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.

Let us accompany you on the journey of exploring knowledge and


personal growth!

textbookfull.com

You might also like