100% found this document useful (7 votes)
75 views90 pages

Excel VBA Step by Step Guide To Learning Excel Programming Language For Beginners 1st Edition by Jason Jay ISBN 1976198127 9781976198120

The document provides a comprehensive guide to learning Excel VBA, aimed at beginners, and includes instructions on accessing the Developer TAB, creating and running macros, and understanding relative references. It features multiple chapters covering practical applications, quizzes for self-assessment, and links to additional resources for further learning. The guide emphasizes the importance of VBA in automating tasks within Microsoft Excel and enhancing productivity.

Uploaded by

yunitafurlow
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 (7 votes)
75 views90 pages

Excel VBA Step by Step Guide To Learning Excel Programming Language For Beginners 1st Edition by Jason Jay ISBN 1976198127 9781976198120

The document provides a comprehensive guide to learning Excel VBA, aimed at beginners, and includes instructions on accessing the Developer TAB, creating and running macros, and understanding relative references. It features multiple chapters covering practical applications, quizzes for self-assessment, and links to additional resources for further learning. The guide emphasizes the importance of VBA in automating tasks within Microsoft Excel and enhancing productivity.

Uploaded by

yunitafurlow
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/ 90

Visit ebookball.

com to download the full version and


explore more ebook or textbook

Excel VBA Step By Step Guide to Learning Excel


Programming Language for Beginners 1st Edition by
Jason Jay ISBN 1976198127 9781976198120

_____ Click the link below to download _____


https://ebookball.com/product/excel-vba-step-by-step-guide-
to-learning-excel-programming-language-for-beginners-1st-
edition-by-jason-jay-isbn-1976198127-9781976198120-15878/

Explore and download more ebook or textbook at ebookball.com


Here are some recommended products that we believe you will be
interested in. You can click the link to download.

Java Easy Java Programming for Beginners Step By Step


Guide to Learning Java 1st Edition by Felix Alvaro ISBN
1539509362 9781539509363
https://ebookball.com/product/java-easy-java-programming-for-
beginners-step-by-step-guide-to-learning-java-1st-edition-by-felix-
alvaro-isbn-1539509362-9781539509363-15874/

Java programming A beginners guide to java Step by Step


1st Edition by Troy Dimes 1507562942 978-1507562949

https://ebookball.com/product/java-programming-a-beginners-guide-to-
java-step-by-step-1st-edition-by-troy-
dimes-1507562942-978-1507562949-17382/

Microsoft Excel 2016 Step by Step 1st Edition by Curtis


Frye ISBN 0735697469 9780735697461

https://ebookball.com/product/microsoft-excel-2016-step-by-step-1st-
edition-by-curtis-frye-isbn-0735697469-9780735697461-16138/

PYTHON'S COMPANION A STEP BY STEP GUIDE FOR BEGINNERS TO


START CODING TODAY 1st edition by Joe Thompson ISBN
0123456789 978-0123456789
https://ebookball.com/product/python-s-companion-a-step-by-step-guide-
for-beginners-to-start-coding-today-1st-edition-by-joe-thompson-
isbn-0123456789-978-0123456789-16686/
Excel 2016 Power Programming With VBA 1st Edition by
Michael Alexander, Richard Kusleika ISBN 1119067723
9781119067726
https://ebookball.com/product/excel-2016-power-programming-with-
vba-1st-edition-by-michael-alexander-richard-kusleika-
isbn-1119067723-9781119067726-15876/

Research Methodology A Step By Step Guide for Beginners


3rd Edition by Ranjit Kumar 1849203016 978-1849203012

https://ebookball.com/product/research-methodology-a-step-by-step-
guide-for-beginners-3rd-edition-by-ranjit-
kumar-1849203016-978-1849203012-17356/

Machine Learning Step by Step Guide To Implement Machine


Learning Algorithms with Python 1st Edition by Rudolph
Russell ISBN 9781719528405
https://ebookball.com/product/machine-learning-step-by-step-guide-to-
implement-machine-learning-algorithms-with-python-1st-edition-by-
rudolph-russell-isbn-9781719528405-16086/

Assembly Language Step by Step Programming with DOS and


Linux 2nd Edition by Jeff Duntemann ISBN 0471375233
9780471375234
https://ebookball.com/product/assembly-language-step-by-step-
programming-with-dos-and-linux-2nd-edition-by-jeff-duntemann-
isbn-0471375233-9780471375234-12520/

(Ebook PDF) RESEARCH METHODOLOGY a step by step guide for


beginners 1st edition by Ranjit Kumar
1849203016‎ 978-1849203012 full chapters
https://ebookball.com/product/ebook-pdf-research-methodology-a-step-
by-step-guide-for-beginners-1st-edition-by-ranjit-
kumar-1849203016aeurz-978-1849203012-full-chapters-23028/
EXCEL VBA

Step-By-Step Guide To Learning Excel


Programming Language For Beginners

Jason Jay
© Copyright 2017 by Jason Jay - All rights reserved.

If you would like to share this book with another person, please purchase an
additional copy for each recipient. Thank you for respecting the hard work of
this author. Otherwise, the transmission, duplication or reproduction of any of

the following work including specific information will be considered an


illegal act irrespective of if it is done electronically or in print. This extends
to creating a secondary or tertiary copy of the work or a recorded copy and is
only allowed with express written consent from the Publisher. All additional
right reserved.
TABLE OF CONTENT
EXCEL VBA 1
Introduction 5
CHAPTER 1 7
VBA Developer TAB 7
Accesing to the Developer TAB 7
Quiz 1 8
CHAPTER 2 9
Macros 9
Creating a Macro 9
Relative References 11
Running the Macro 12
Saving a Macro-Enabled Workbook 12
Quiz 2 14
CHAPTER 3 16
Starting with VBA 16
What if I need to fill the cells up to 100? 19
Insert Form Button 21
Simple things a Macro can’t do. 22
Insert ActiveX Button 22
Variables, Do and Loop. 23
What is the advantage of declaring variables as byte, integer or any other? 31
APPs Performance 35
MSGBOX 39
If and Select Case 40
Quiz 3 43
CHAPTER 4 45
Project: Creating a Simple Calculator using ActiveX 45
What is a Module? 45
How to create a Module 46
Adding Letters? 58
Quiz 4 59
CHAPTER 5 60
Project: Calculator using Forms 60
Review 60
FORMS 61
Commmand Buttons code 65
Excel Formulas on VBA 74
Combining VBA and a Spreadsheet 75
Starting with Declarations: 78
Open and Close declarations: Displaying a form without looking any spreadsheet 81
Macro Security 87
Comments 89
The whole code for Calculator Project 94
Command Buttons Order 101
Adding Password to VBA Code. 102
Quiz 5 104
Interacting with other Applications. 105
Opening other apps from Excel 105
Sending an Outlook e-mail from Excel: 108
Exercises Solutions: 111
Answers Chapter 1 111
Answers Chapter 2 112
Answers Chapter 3 113
Answers Chapter 4 114
Answers Chapter 5 115
Introduction

If you already know how to use Microsoft Excel but there’re a few
things you can’t do, it is time to learn the strongest functionality it has, Visual
Basic for Applications (VBA).
Visual Basic for Applications is a programming language incorporated
in Microsoft Excel, Access, PowerPoint and even Word, which let you do all
things you already know about them and much more. For example, you want
that every time you open a specific Microsoft Word file it writes
automatically the current date two lines below where you left last time. Or
maybe you want a whole spreadsheet of Excel without formulas on it and still
applying them as if they were there. How would you do that? All these things
and much more are done with Visual Basic for Applications for Microsoft
Office.
Look at the example below:

It looks like a program made for analysis, and it does. Guess what
program it is? Probably you are thinking it is not any Microsoft Office
program, but let me tell you that it was made with Microsoft Excel, how
would you do something like that without programming? There’s no way!
You’ll learn much more than that and will be able to create your own
programs using Visual Basic for Applications (VBA).
If you need a very specific program for your business analysis,
something for personal use, or even just for having fun, you need Visual
Basic for Applications now!
CHAPTER 1
VBA Developer TAB

Every programming language has similarities between their


fundamentals. The functions IF, Then, Loop, Close, Open, are just some of
them. We’ll learn the basic ones first; it will be necessary to understand how
VBA works.

We’ll use Microsoft Excel 365 for this instructions and examples, however,
from Microsoft Excel 2007 onwards it will work the same.
Accesing to the Developer TAB

Microsoft Excel doesn’t show the Developer TAB by default. It only has
File, Home, Insert, etc. But there’s no one called Developer. To access to this
TAB there are different options, but we’ll show the easiest one.
1. Right click to the Ribbon (any part inside the red box, except the
buttons).

2. Select Customize the Ribbon

3. Enable the Developer checkbox and click the OK button.


4. You should see the Developer TAB available now.

Quiz 1

1. How you Access the Developer TAB?


a) It is available by default in Excel.
b) Right click on the Ribbon, Customize the Ribbon, enable the
Checkbox for Developer and Accept.
c) Go to file, Options, Advanced and Enable the Developer TAB.
CHAPTER 2
Macros

Creating a Macro
You’ll see a few options available in the Developer TAB, by now we’ll start
to use the Record Macro button.
A Macro is an automated sequence which will apply every time you play it.
Let’s see a practical example of it:
Imagine that in your job you do the same process every morning. It takes
some valuable time and even you’re getting bored of that.
The process is the following:
a) You receive a Microsoft Excel file from your boss with some data
and you need to write the date using Year, Month and Day in different
columns.
You do this because it is the format your job needs and you’ve been adding
the same values every day for a few years.
In this case an semi-automated process would be helpful. Excel gives that
option to all of us with Macros. A Macro is a semi-automated process which
let you run a specific task using a shortcut.
To create a Macro, follow the sequence below:
a) Click the Record a Macro Button.
b) Write a name for your Macro. (Needed)
c) A shortkey which every time you press will Run the Macro. Be
careful, don’t add Ctrl + C or Ctrl + v, otherwise it won’t copy or paste
anymore, but run the Macro. In case you want a more specific shortcut,
hold the shift key as you press a letter. For example, ctrl + shift + c. To
make it work, don’t press ctrl as you add a short cut. (Optional)
d) Store Macro in: Personal workbook: Will be available for all the
files you open with Excel on that computer; New Workbook will be
available for a new file only. This workbook, will apply only to the
current open file. (Needed to choose one)
e) Write a description about what that Macro does. (Optional)
f) Click Ok.

g) Start doing everything you always do, which would be adding the
current date in this case.
h) Once you finish, go back to the Record Macro Button, which now is
called Stop Recording. Press it and now should be saved.
This would be a very simple Macro, it only adds the current date, but what
would you think if you also need to import data from a web page which is
updated every hour, and need to classify it using a few charts, and you do the
same process several times a day. No doubt, a good Macro would be useful.
The process to get it any Macro, is the same we’ve followed. There’s only an
important thing to consider when creating one, it is to choose between using
Relative References or not.

Relative References
The Relative References button is just below the Record a Macro Button.
Once you click on it, it remains active until you click on it again. It is used to
record macros in which the process should be applied to different ranges
instead of one already set.
Its functionality is very useful. A macro recorded without relative references
will always repeat the process on the same cells used when recorded. But if
you use relative references, the macro will run from the active cell. Using the
example above, what If you need the dates written on cells F4:H4 instead of
B2:D2? The only thing you should do is to select F4 and run the Macro. Or
select any cell you need and run it. But you need to record the Macro using
Relative References, and then select the cell and run it, otherwise it wouldn’t
work.

Running the Macro


There are a bunch of ways to run a Macro. Let’s see the first: Run this one by
clicking on the Macros Button, then click on it to run it.
Maybe it is not as practical as we expected, however, we’ll add more
functionality and make it easier to run in the next step.

Saving a Macro-Enabled Workbook


Once you have added some Macros to your worksheet and try to save it
you’ll get a notification like the following:

This might be a little tricky, because most people would attempt saving the
file without reading this notification:
The following features cannot be saved in macro-free workbooks:
°VBA project
To save a file with these features, click No, and then choose a macro-enabled
file in the File Type list.
To continue saving as a macro-free workbook, click Yes.
Most people would just click Yes, and according to this message they
wouldn’t save the file with their Macros, but as Macro free. It would make
you lose all your Macro work.
To save the Macro, just click No to the message above, then select save as
Excel Macro-Enabled Workbook.
Click on Save, and it is done!
Once you open it again, you should see a message saying Macros have been
disabled, and a Button saying Enable Macros. Click on it and won’t have
further problems. If you don’t click on it, you won’t be able to work with
VBA, at least you enable them on Macro Security in the Developer TAB, or
follow the steps on Chapter 5: Macro Security.

Quiz 2
1. What is a Macro?
a) It is an Excel Formula
b) It is a shortcut which runs a recorded process.
c) It is a built-in process included in Excel.

2. How to create a Macro?


a) Clicking on the Visual Basic Button
b) Clicking on the Macros Button
c) Clicking on the Record Macro Button

3. What is Relative References for?


a) It is to Record a Macro without set specific cells.
b) It is to Record a Macro with specific cells.
c) Without it a Macro isn’t editable.

4. How to Run a Macro?


a) Clicking on the Macro Button
b) Clicking on the Record Macro Button
c) Clicking on the Relative References Button

5. How to save a workbook with Macros?


a) Just save the file normally, the Macros will be saved.
b) You’ll get a notification, in which we should be denied and then
select save as Macro-Enabled Workbook.
c) You’ll get a notification, in which we will be notified that we are
saving a Macro-enabled workbook, then just accept to save.
CHAPTER 3
Starting with VBA

Macros are fundamental to be introduced to VBA.


Let’s see why by following the process:
1.-Create a new Macro without relative references.
2.-In the process select the cell A1, write a number 1, and press enter.
3.-Stop Recording.

Next to the Record Macro button, there’s another one called Visual Basic.
Click on it and you’ll see a code like this:

Range("A1").Select
ActiveCell.FormulaR1C1 = "1"
Range("A2").Select

Congrats, you have some Visual Basic Code now. It means a few orders:
Select Cell A1
Write the number 1
Select Cell A2

It is exactly what we did. But now, we’ll edit the code so that the Macro does
something else.
If we see, there’s a pattern, which is: select, write, select. So, we could
continue the pattern by adding a few more things directly, like this:

Range("A1").Select
ActiveCell.FormulaR1C1 = "1"
Range("A2").Select
ActiveCell.FormulaR1C1 = "2"
Range("A3").Select
ActiveCell.FormulaR1C1 = "3"
Range("A4").Select

Now that you added this, run the macro, but now you’ll see a second way to
run it. Press the green button above the code. Once you click on it go to the
Excel Spreadsheet by clicking on the Excel symbol. You’ll see that the cells
A1:A3 are filled with the numbers we wrote and the Cell A4 is selected.
It may look very complex, and it is like that because humans use to do things
that machines wouldn’t. I needed to select cell A1, A2, A3 and son on. But
does Excel really need to select it to write a simple number?
Let’s try it by adding the following code:

Range("A1") = 1
Range("A2") = 2
Range("A3") = 3

That’s it! Excel can skip steps humans can’t. So, it makes it much more faster
and easy to accomplish its work.

What if I need to fill the cells up to 100?


Now, I think that if I need to follow this pattern until A100 is going to be
hard. What should I do?
Let’s add this:

Range("A1:A100") = 1

Oops! It adds a number 1 to all cells from A1 to A100. Let’s try another
thing:

Range("A1:A100") = 1 + 1

It adds a number two instead. So, How do I tell Excel that I want it to fill
cells in sequence?

There are several ways. One is to record a Macro and during the process add
a number 1 to the cell A1, then hold right click on the small square and scroll
down until you select A100. Select fill series. Go to Visual Basic and you’ll
see a code like this:

Range("A1").Select
ActiveCell.FormulaR1C1 = "1"
Selection.AutoFill Destination:=Range("A1:A100"),
Type:=xlFillSeries
Range("A1:A100").Select
It works! I think we already have a great idea about how to get the VBA code
we want. Record a Macro, and there it is. However, there’re a lot of functions
that Macros can’t offer. For example, fill up cells in sequence according to
the number written in cell B2, and once it changes fill up the sequence again
according to that number. So, if there’s a number 1 it will be filled one by
one, if I change it to five, it’ll go five by five and so on. How are you going
to record that in a Macro? What if it is not just filling up a sequence, but a
Financial matter, working with real numbers and you need to solve a problem
like this fast?
Recording a Macro isn’t enough always, but in most cases, it helps.
Visual Basic Application (VBA) is a programming language, but it is not
necessary to know VBA code or computer programming if the Macro
Recorder does what you want.
You should know that when you record a Macro it records even your
mistakes, and it will repeat them when you run it. If you want to solve a
problem like this you have two options:
1. Record the Macro again.
2. Edit the VBA code.
Remember that recording a good Macro or writing a good VBA code,
will make Excel to run smoothly. Otherwise, you can expect a not
responding message until it finishes or maybe it even could stop
working.
We’ll focus on things you can’t do using only recorded macros. So, you can
learn how powerful Visual Basic for Applications is in Microsoft Excel.

Insert Form Button


We have some Macros recorded now. But we see that to run them it is not
that handy, so what if we add a button, and every time we press it on the
macro runs?
To do that, click on the insert button in the Developer TAB. You’ll see it
displays two boxes, called form controls and ActiveX Controls. Let’s select
the Form Control Button, then wherever you want on the spreadsheet hold
and drag to create the size of the button. Once you stop holding you’ll see a
new window in which you will be able to choose the Macro you want the
Button to run. Select it and it’s done.
If you want to change the name of the button just click on it twice slowly or
right click, edit text. To move the position of the button, just right click, and
then hold and drag with the left click.

Easy, don’t you think?

Simple things a Macro can’t do.


Insert ActiveX Button
Let’s add an ActiveX Button. To do this in the Developer TAB click on
Insert, and then select ActiveX Button. Hold and drag to create the button in
the spreadsheet. This kind of button are very different than Form Buttons,
because these ones work directly with VBA.
Let’s add some functionality which can’t be done using Macros only. We
want that button to create a sequence of numbers according to the value
inserted in cell B2. I mean, if I add number 1 then I’ll see a pattern going one
by one. If I write 5, then it will go five by five, and so on, from A1 to A100.
This is a great opportunity to explain Variables.

Variables, Do and Loop.


A variable is an algebraic term, which is usually represented by a letter and
its value varies, for example, x + y = 10, in this equation there are two
variables, X and Y. They can vary to equal 10. If X = 5 and Y = 5 then
x+y=10 , and it is also correct if X= 8 and Y=2, because X+Y= 8+2 = 10.
Etc.

In VBA we declare variables too. In this case we’ll add some functionality to
the ActiveX Button we added in the previous step.
First, we’ll need to choose the correct numeric variable.

These are the most types of variables, check them out and see their storage
size and range by now:

Data type Storage Range


size
Byte 1 byte 0 to 255

Boolean 2 bytes True or False

Integer 2 bytes -32,768 to 32,767

Long 4 bytes -2,147,483,648 to 2,147,483,647


(long integer)
Single 4 bytes -3.402823E38 to -1.401298E-45 for negative
(single- values; 1.401298E-45 to 3.402823E38 for
precision positive values
floating-point)
Double 8 bytes -1.79769313486231E308 to
(double- -4.94065645841247E-324 for negative values;
precision 4.94065645841247E-324 to
floating-point) 1.79769313486232E308 for positive values

Currency 8 bytes -922,337,203,685,477.5808 to


(scaled integer) 922,337,203,685,477.5807

Decimal 14 bytes +/-79,228,162,514,264,337,593,543,950,335


with no decimal point;
+/-7.9228162514264337593543950335 with 28
places to the right of the decimal; smallest non-
zero number is
+/-0.0000000000000000000000000001

Date 8 bytes January 1, 100 to December 31, 9999

Object 4 bytes Any Object reference


String 10 bytes + 0 to approximately 2 billion
(variable- string
length) length
String Length of 1 to approximately 65,400
(fixed-length) string
Variant 16 bytes Any numeric value up to the range of a Double
(with numbers)
Variant 22 bytes + Same range as for variable-length String
(with string
characters) length
User-defined Number The range of each element is the same as the
(using Type) required by range of its data type.
elements

In this table, we see that each variable has different ranges, some larger than
others, and in the same time the size storage varies too. The smallest unit of
memory available is called a byte, and according to this table it goes from
number 0 to 255.
Let’s do this to start:
1. Enable the Design Mode Button, which is next to the Insert Button in
the Developer TAB.
2. Double click on the ActiveX Button.
3. Now you’re ready to write the code for it.

Private Sub CommandButton1_Click()


End Sub
That’s what you should see.
Now let’s write some code between those lines we see:

Private Sub CommandButton1_Click()


Dim X As Byte
Dim Y As Byte

X=1
Y = Range("B1")
Do
Range("A" & X) = Y
X=X+1
Y = Y + Range("B1")
Loop Until X = 101
End Sub

This is the meaning of this code. It says:


Private Sub CommandButton1_Click()
Private means that you won’t find the code in the Macros Button.
CommandButton1 is the default name given to the ActiveX Button, and Click
means that the code below will be applied only when you click on it.
Dim X As Byte
Dim declares variables, So, it says that X is a variable that will be used
with numbers from 0 to 255, because “Byte” only accepts that range
according to the table above.
X=1
I added the initial value for the variable, which will be 1.
Y=Range(“B1”)
Means that the value of the variable Y is the same value as cell B1.
Do
Means do this.
Range(“A” & X) = Y
We already declared X as a variable with a value of 1. So, the Range
AX means Range(“A1”)=Y, and Y is the Range (“B1”). If I add the number
5 to B1, then Y = 5. So, finally it is Range(“A1”)=5.
X=X +1
It means that X=1+1 because in that moment X=1, so finally X=2. The next
time this process repeats, it will be X=X+1 again, but this time X=2, so
finally X=3, because X=2+1, and so on.

Y = Y + Range("B1")
This will follow the same process as the last step, but with the value added in
Range(“B1”) which will be that one we added. If B1 has a 5, then it will add
another 5, following a sequence according to what we wrote on B1.
Loop Until X = 101
It means that the same process between Do and LOOP will be repeated until
X=101.
End Sub
Means the end of the procedure.

Let’s try it now!


Add the number 1 to the cell B1 and press the button. You’ll see that it fills
up the cells from A1 to A100 one by one. Try it with two, and you’ll see that
it adds from A1:A100 two by two. Finally add the number 3 and press the
button.
Congrats! You’ve found your first bug! It is an overflow.

Bugs are errors when one writes a wrong code. In our example the code
works fine with numbers from 0 to 255 only, and once we ask the file to go 3
by 3 one hundred times we are expecting it to go from 3 to 300, which is
more than 255, so it causes an overflow.
To fix it, we have two options, we increase the value of the variable or we let
Excel to add it automatically.
Let’s consider the possibility of increasing the capacity of the variable, we
can change it from byte (0 to 255) to integer (-32,768 to 32,767). It will be
great if we were pretty sure that we won’t work with higher numbers of
32,767, or even change it to “long” which goes from -2,147,483,648 to
2,147,483,647. It would be great to work even with millions, but let’s
imagine that someone needs to put billions in B1. In that case even a long
variable wouldn’t be enough. So, the best way to solve this is don’t declare
the variable and leaving the code in the following way:
Private Sub CommandButton1_Click()
Dim X As Byte
X=1
Y = Range("B1")
Do
Range("A" & X) = Y
X=X+1
Y = Y + Range("B1")
Loop Until X = 101
End Sub

Or declaring the value as Variant, which let any number or letters.

Private Sub CommandButton1_Click()


Dim X As Byte
Dim Y As Variant
X=1
Y = Range("B1")
Do
Range("A" & X) = Y
X=X+1
Y = Y + Range("B1")
Loop Until X = 101

End Sub

What is the advantage of declaring variables as byte, integer or any


other?
Maybe you are wondering why to declare a variable as byte or integer, etc. If
Excel can add one automatically as in the example we’ve seen?
The answer is simple and important to know. Let’s remember that a variable
as byte stores in RAM Memory only 1 byte, which is the smallest amount of
memory possible in Excel, but a variant declared as variant stores at least 22
bytes. If we don’t declare a value in which we are sure won’t add more than
the needed values, it will consume more RAM, it will cause a program to run
slow in very simple tasks.
For example, I need to declare 1000 variables as byte. It would consume 1
Kilobyte of RAM only.
But By default, if you don't supply a data type, the variable is declared as
Variant data type, which consumes 22 bytes + string length, string length is
for letters.
So, 1000 variables not declared would be automatically declared as variant,
and it would consume 22 kilobytes. It is 21 empty kilobytes, which is 95% of
not available space and don’t used at all in case we would have required them
as bytes instead. If you are going to program in VBA and want your program
to run smoothly, you better learn what kind of variable to declare. Otherwise,
it will probably take long to load and then will run slow.

Require Variable Declaration Importance

Probably, one of the biggest problems about not declaring a Variable are
creating bugs, because we simply type something wrong. Let’s make a simple
example of it.

1. Open Visual Basic


2. Double Click on ThisWorkbook
3. Add the following code:

Public Sub Infinite()


myvariable = 200
myrange = 1
Do Until myvariabe = 300
Range("A" & myrange) = myvariable
myvariable = myvariable + 1
myrange = myrange + 1
Loop
End Sub

As you see it is a very similar code to one we did before. It should stop once
myvariable equals 300, but it continues. Can you see the problem?
If not, run the code. You’ll notice that it will go beyond 300, and practically
will have no end, or at least until it has no more files. In Excel 365 the total
files available is 1048576, so it will go until A1048576 and will enter on an
error.
If you don’t want to wait until that, Press ESC Key which will interrupt the
code execution and then press End Button.

Well, the problem is that we miss just one letter of a variable. We named it
myvariable but when coding we miss the letter L : Do Until myvariabe. Excel
identified myvariable and myvariabe as two different variables, and
automatically assigns them as Variant type.
What would have happened if your code has a lot of code? To find the
problem you should look at all your code to find the letter you missed! As
you see it would be a big trouble! That’s why Microsoft Excel has an option
called Require Variable Declaration.
It won’t let you write anything which is not code or a declared variable. To
enable this feature do the following:

1. Visual Basic
2. Tools Tab
3. Options
4. Require Variable Declaration
5. Ok.

It will add something above the code, which says Option Explicit. But, you
won’t see that change until you start a new project, insert a module or you
write it by yourself. That’s why it is important to start a new project always
with this option enabled.
In this case, add Option Explicit manually above the code.

Option Explicit
Public Sub Infinite()
myvariable = 200
myrange = 1
Do Until myvariabe = 300
Range("A" & myrange) = myvariable
myvariable = myvariable + 1
myrange = myrange + 1
Loop
End Sub

After you added this code Run it!


You’ll see that it automatically displays a message saying Variable Not
Defined and even highlight the problem. So, you can see that it will avoid
further problems for misspell variables.

APPs Performance

Now, imagine that you really need to fill one by one all the cells from A1 to
A1048576, and that it is one of the functionalities your APP should do.
Almost always Developers are concerned about creating Apps which run fast.
In Excel it is not an exception. Try running the following code and see how
long it takes to fill all column A with numbers:

Public Sub FillColumnA()


Dim X As Long
X=1
Do Until Range("A1048576") <> Empty
Range("A" & X) = X
X=X+1
Loop
MsgBox "Finished"
End Sub

When it finishes it will display a message saying “Finished”. It will probably


take about 5 minutes, maybe less or more depending on your computer
performance. You probably will notice Excel saying that it is not responding,
but in most cases it is still working. I don’t want to wait too long!
A good way VBA Developers make Apps run faster, is by disabling the
ScreenUpdating. Every change Excel does we are supposed to see it. But, if
we don’t want to see it, it will definitively improve its performance.
Let’s change the code to this:
Public Sub FillColumnA()
Dim X As Long
On Error GoTo A
Application.ScreenUpdating = False
X=1
Do Until Range("A1048576") <> Empty
Range("A" & X) = X
X=X+1
Loop
A:
MsgBox "Finish"
End Sub

Run it and time how long it takes, then compare how faster this way is. Don’t
forget to erase Column A before you start. You should notice a big
difference! Screenupdating is a great tool when need to increase an App
performance. However, now go to the spreadsheet and try to do something.
You should notice that it is not possible to do anything, or at least you won’t
see that, because screenudating = false turned off the visibility changes. So,
when you use Application.screenupdating = false NEVER forget to add
Application.ScreenUpdating = True at then end of your code, and even better
as a backup in case of error do as the code below:

Public Sub FillColumnA()


Dim X As Long
On Error GoTo A
Application.ScreenUpdating = False
X=1
Do Until Range("A1048576") <> Empty
Range("A" & X) = X
X=X+1
Loop
A:
Application.ScreenUpdating = True
MsgBox "Finished"
End Sub
MSGBOX

As you saw in the code above, it displays a message saying “Finished”. We


can do much more than that!
One of those messages can execute code too! Look at the table below:

Constant Value
vbOK 1
vbCancel 2
vbAbort 3
vbRetry 4
vbIgnore 5
vbYes 6
vbNo 7

Those are the kind of messages you can display, and once you click on it, it
will return the value according to the table above.
Run the following code:
Public Sub fff()
Dim X As Byte
X = MsgBox("This is the body",
vbYesNoCancel, "This is the title")
MsgBox X
End Sub
It will display a msgbox with a Yes, No and Cancel button. Once you click
on any button, X will take that value and will display it on the next MsgBox.
So, if you click on Yes, you’ll see a number 6, and if you click on No, you’ll
see a number 7.
This is a great advantage, because we can ask if user want to proceed or
not, etc.

If and Select Case

We see that once we are adding a msgbox, we can also create a warning
message, or information, or critical, etc. Let’s combine one in the code
below, so we can figure out how to do it:

Public Sub myMessageBox()


Dim X As Byte

X = MsgBox("I'll tell you the button you pressed on", vbYesNoCancel +


vbExclamation, "What Button would you press?")
If X = 2 Then
MsgBox "You Pressed Button Cancel"
ElseIf X = 6 Then
MsgBox "You pressed Button Yes"
Else
MsgBox "You pressed Button No"
End If

End Sub
It will tell you the button you pressed. It means that if you can know
what button is pressed on then you can control an action according to it. For
Example execute a Macro.

If is the conditional. Like:


Public Sub Evaluation()
Dim X As Byte

X = Range("A1")
If X = 5 Then
MsgBox "There's a number " & X
ElseIf X = 6 Then
MsgBox "There's a number " & X
ElseIf X = 7 Then
MsgBox "There's a number " & X
ElseIf X = 8 Then
MsgBox "There's a number " & X
Else
MsgBox "There's another value"
End If
End Sub
So “if” makes a conditional, “elseif” is checked in case the first condition
doesn’t meet, and will check as many “elseif” as you add until one condition
meet. “Else” will run in case any condition doesn’t meet. So, if we don’t add
any number from 5 to 8, we’ll see a message saying “There’s another value”,
but if we put a number 8, then we’ll see a message saying There’s a number
8.
If, elseif and else are very similar to another kind of code called Select Case,
Case, and Case Else However, this one is more efficient than IF in some
cases. Let’s do the same than above but using case instead:

Public Sub Cases()


Dim X As Byte
X = Range("A1")
Select Case Range("A1")
Case 5 To 8
MsgBox "There's a number " & X
Case Else
MsgBox "There's another value"
End Select
End Sub

This last one occupies much less code. It was easier and better. You can do
practically the same but is up to you which one you want to use.
Quiz 3

What is a Variable?
a) It is a value which never changes.
b) It is a value which changes.
c) It is a special number.

What is the storage size of a byte variable and its range?


a) It stores 2 bytes and goes from -32567 to 32567.
b) It stores 1 byte and goes from -256 to -256.
c) It stores 1 byte and goes from 0 to 256.

What is the advantage of declaring variables?


a) It consumes less RAM and makes it run smoothly.
b) It consumes more RAM and makes it run slower.
c) It wouldn’t work if variables aren’t declared.

Is it obligatory to declare variables?


a) Only if Require Variable Declaration is enabled
b) It is obligatory in all circumstances
c) It is not, Excel declares them automatically according to the value
added.

Msgbox returns a value depending on the button pressed:


a) We assign the value to each button
b) It returns a value depending on the button pressed
c) Values aren’t returned
CHAPTER 4
Project: Creating a Simple Calculator using
ActiveX

We’re going to create a simple calculator first. After this project is


completed, we’ll create a more sophisticated one. To do that, we’ll require to
know the following:

What is a Module?
When we start writing VBA code, we’ll usually start writing on Sheet1. But,
in order to understand Modules, Procedures Private and Public, we’ll create a
visual calculator. First, we´ll do it on a spreadsheet, and then we’ll do it as a
real program.

A module, is something like a Box, in which we add some code to run when
we “call” it. To understand how it works, we’ll create our calculator using a
few Modules.

How to create a Module


First, add the following ActiveX buttons on a spreadsheet on the table as it is
shown on the image. To add the appropriate symbol to each button, it is not
as we did on the Form Buttons. In this case we have to click on the Design
More Button, which is in the developer TAB, then right click on each button
and you’ll see something like the image below, in which we see something
called “Name”. Most people would think that there’s where we can add the
correct symbol to see, but that’s wrong. Excel identify the Button with that
name. Imagine you have several buttons with + as their name. How would
either Excel or you identify which one is the correct? So, every button will
have a different name, let’s add a good one which let us know what it does
like In the example I wrote cmdAddition. It lets me know that that it applies

to the “+” Button. However, how can I add the sign +?

In the image above, you ‘ll see that there’s a property called Caption. That’s
where You’ll add the “+” sign.
You can even play a little bit with the other options, like the Backcolor, Font,
Height and even add a picture. I left all options as they were by default.

Once you repeated the process for all the buttons, let’s start with the next
steps. Let’s create a Module!
Follow these steps:

1. Open Visual Basic through the Developer TAB. By default you’ll see
something like this:

2. Click on “View TAB” and select “Properties Window”. We’ll always


use this window a lot. Now you should see something like what’s
shown inside the red square:
3. Let’s add our first Module. Click on Insert TAB, then Module.

4. You’ll see a New Folder Called “Modules” with a file there Called
“Module 1”:

5. Select it and in the Properties Window Change its name to Addition,


then repeat the process until you have created a Module for Minus,
Division and Times.
6. Double click on the Module “Addition” to open it.
7. You’ll see that it displays an entire blank sheet. We need to add a
Procedure! To do that, click on Insert TAB, then Procedure. It will
display a window like this, add a name and leave the default options:

8. Click OK and you’ll see this:

9. Between those lines write the following code:

Range ("A2") + Range("B2") = Range("C2")

10. Now run it by clicking the green triangle above.


11. It is displaying an error saying: Invalid use or Property.
Maybe it is because we haven’t added any number in the cells A2 and
B2. Add them and run it again.

It is still having a problem! Can you see what’s wrong?

Welcome to your second bug! The problem here is a very usual one. We are
asking Excel that cells A2 + B2 are equals to C2 instead of C2 equals to A2 +
B2. This problem is just an order problem. You better don’t forget this rule!!
Always add first the cell you want to be changed, then add the values that
you’ll need. Like this:
Range("C2") = Range("A2") + Range("B2")

Run it again with the same green triangle.


OK! It works!

If you see a yellow line which doesn’t let you run it, just click stop, correct
your code and run it again.

Now you’ll see that in the cell C2 we find the result of A2+B2.

Let’s complete the other modules repeating the correct process above. Add
these codes to do that:

Minus Module:
Public Sub Minus()
Range("C2") = Range("A2") - Range("B2")
End Sub

Division Module:

Public Sub Division()


Range("C2") = Range("A2") / Range("B2")
End Sub

Times Module:

Public Sub Times()


Range("C2") = Range("A2") * Range("B2")
End Sub

You’re supposed to see a file like this:


All the modules should work if you run them.

Now, let’s link the Modules to their appropiate button.

To do that just do the following:

1. Go to the spreadsheet
2. Click on Design Mode
3. Double click each button. You’ll see that every time you do it, it adds
some code to the Sheet1(Sheet1). Finally, it should look like this:
Other documents randomly have
different content
was so interesting that for a few moments they were oblivious to all
else.
A man softly stepped to the door of the Victoria and watched
the two across the street with an expression on his face that showed
his smiling contempt for them and their kind. He was a small man,
so far as physical measurements go, but he was lithe, sinewy and
compact. On his opened vest, hanging slovenly and blinking in the
growing light as if to prepare itself for the blinding glare of midday,
glinted a five-pointed star of nickel, a lowly badge that every rural
community knows and holds in an awe far above the metal or
design. Swinging low on his hip gleamed the ivory butt of a silver-
plated Colt, the one weakness that his vanity seized upon. But under
the silver and its engraving, above and before the cracked and
stained ivory handles, lay the power of a great force; and under the
casing of the marshal's small body lay a virile manhood, strong in
courage and determination. Toby Harris watched, smilingly; he loved
the dramatic and found keen enjoyment in the situation. Out of the
corner of his eye he saw a carelessly dressed cowpuncher slouching
indolently along close to the buildings on the other side of the street
with the misleading sluggishness of a panther. The red hair, kissed
by the slanting rays of the sun where it showed beneath the soiled
sombrero, seemed to be a flaming warning; the half-closed eyes,
squinting under the brim of the big hat, missed nothing as they
darted from point to point.
The marshal stepped silently to the porch and then on to the
ground, his back to the rear of the hotel, waiting to be discovered.
He had been in sight perhaps a minute. The cowpuncher made a
sudden, eye-baffling movement and smoke whirled about his hips.
Fred, turning the corner behind the marshal, dropped his gun with a
scream of rage and pain and crashed against the window in sudden
sickness, his gunhand hanging by a tendon from his wrist. The
marshal stepped quickly forward at the shot and for an instant gazed
deeply into the eyes of the startled rustlers. Then his Colt leaped out
and crashed a fraction of a second before the brothers fired. George
Thomas reeled, caught sight of the puncher and fired by instinct.
Bill, leaving Harris to watch the other side of the street, was
watching the rear corner of the Victoria and was unprepared for the
shot. He crumpled and dropped and then the marshal, enraged,
ended the rustler's earthly career in a stream of flame and smoke.
Tom, turning into the street further down, wheeled and dashed for
his horse, and Art, having leaped behind the harness shop, turned
and fled for his life. He had nearly reached his horse and was going
at top speed with great leaps when the prostrate man in the street,
raising on his elbow, emptied his gun after him, the five shots
sounding almost as one. Art Thomas arose convulsively, steadied
himself and managed to gain the saddle. Harris looked hastily down
the street and saw a cloud of dust racing northward, and grunted.
"Let them go—they won't never come back no more." Running to
the cowpuncher he raised him after a hurried examination of the
wounded thigh. "Hop along, Cassidy," he smiled in encouragement.
"You 'll be a better man with one good laig than th' whole gang was
all put together."
The puncher smiled faintly as Hawley, running to them, helped
him toward his hotel. "Th' bone is plumb smashed. I reckon I 'll hop
along through life. It 'll be hop along, for me, all right. That's my
name, all right. Huh! Hopalong Cassidy! But I didn't hop into h—l,
did I, Harris?" he grinned bravely.
And thus was born a nickname that found honor and fame in
the cow-country—a name that stood for loyalty, courage and most
amazing gun-play. I have Red's word for this, and the endorsement
of those who knew him at the time. And from this on, up to the time
he died, and after, we will forsake "Bill" and speak of him as
Hopalong Cassidy, a cowpuncher who lived and worked in the days
when the West was wild and rough and lawless; and who, like
others, through the medium of the only court at hand, Judge Colt,
enforced justice as he believed it should be enforced.

VII
"DEALING THE ODD"

Faro-bank is an expensive game when luck turns a cold shoulder on


any player, and "going broke" is as easy as ruffling a deck. When a
man finds he has two dollars left out of more than two months' pay
and that it has taken him less than thirty minutes to get down to
that mark, he cannot be censored much if he rails at that Will-o'-the-
wisp, the Goddess of Luck. Put him a good ten days' ride from
home, acquaintances and money and perhaps he will be justified in
adding heat in plenty to his denunciation. He had played to win
when he should have coppered, coppered when he should have
played to win, he had backed both ends against the middle and
played the high card as well—but only when his bets were small did
the turn show him what he wanted to see. Perhaps the case-keeper
had hoodooed him, for he never did have any luck at cards when a
tow-headed man had a finger in the game.
Fuming impotently at his helplessness, a man limped across the
main street in Colby, constrained and a little awkward in his new
store clothes and new, squeaking boots that were clumsy with
stiffness. The only things on him that he could regard as old and
tried friends were the battered sombrero and the heavy, walnut-
handled Colt's .45 which rubbed comfortably with each movement of
his thigh. The weapon, to be sure, had a ready cash value—but he
could not afford to part with it. The horse belonged to his ranch, and
the saddle must not be sold; to part with it would be to lose his
mark of caste and become a walking man, which all good punchers
despised.
"Ten days from home, knowin' nobody, two measly dollars in my
pocket, an' luck dead agin me," he growled with pugnacious
pessimism. "Oh, I 'm a wise old bird, I am! A h—l of a wise bird.
Real smart an' cute an' shiny, a cache of wisdom, a real, bonyfied
Smart Aleck with a head full of spavined brains. I copper th' deuce
an' th' deuce wins; I play th' King to win for ten dollars when I ought
to copper it. I lay two-bits and it comes right—ten dollars an' I see
my guess go loco. Reckon I better slip these here twin bucks down
in my kill-me-soon boots afore some blind papoose takes 'em away
from me. Wiser 'n Solomon, I am; I 've got old Caesar climbin' a
cactus for pleasure an' joy. S-u-c-k-e-r is my middle name—an' I 'm
busted."
He almost stumbled over a little tray of a three-legged table on
the corner of the street and his face went hard as he saw the layout.
Three halves of English walnut shells lay on the faded and soiled
green cloth and a blackened, shriveled pea was still rolling from the
shaking he had given the table. He stopped and regarded it gravely,
jingling his two dollars disconsolately. "Don't this town do nothin'
else besides gamble?" he muttered, looking around.
"Howd'y, stranger!" cheerfully cried a man who hastened up.
"Want to see me fool you?"
The puncher's anger was aroused to a thin, licking flame; but it
passed swiftly and a cold, calculating look came into his eyes. He
glanced around swiftly, trying to locate the cappers, but they were
not to be seen, which worried him a little. He always liked to have
possible danger where he could keep an eye on it. Perhaps they
were eating or drinking—the thought stirred him again to anger: two
dollars would not feed him very long, nor quench his thirst.
"Pick it out, stranger," invited the proprietor, idly shifting the
shells. "It's easy if yo 're right smart—but lots of folks just can't do
it; they can't seem to get th' hang of it, somehow. That's why it's a
bettin' proposition. Here it is, right before yore eyes! One little pea,
three little shells, right here plumb in front of yore eyes! Th' little pea
hides under one of th' little shells, right in plain sight: But can you
tell which one? That's th' whole game, right there. See how it's
done?" and the three little shells moved swiftly but clumsily and the
little pea disappeared. "Now, then; where would you say it was?"
demanded the hopeful operator, genially.
The puncher gripped his two dollars firmly, shifted his weight as
much as possible on his sound leg, and scowled: he knew where it
was. "Do I look like a kid? Do you reckon you have to coax like a fool
to get me all primed up to show how re-markably smart an' quick I
am? You don't; I know how smart I am. Say, you ain't, not by any
kinda miracle, a blind papoose, are you?" he demanded.
"What you mean?" asked the other, smiling as he waited for the
joke. It did not come, so he continued. "Don't take no harm in my
fool wind-jammin', stranger. It's in th' game. It's a habit; I 've said it
so much I just can't help it no more—I up an' says it at a funeral
once; that is, part of it—th' first part. That's dead right! But I reckon
I 'm wastin' my time—unless you happen to feel coltish an' hain't got
nothin' to do for an age. I 've been playin' in hard luck th' last week
or so—you see, I ain't as good as I uster be. I ain't quite so quick,
an' a little bit off my quickness is a whole lot off my chances. But th'
game's square—an' that's a good deal more'n you can say about
most of 'em."
The puncher hesitated, a grin flickering about his thin lips and a
calm joy warming him comfortably. He knew the operator. He knew
that face, the peculiar, crescent-shaped scar over one brow, and the
big, blue eyes that years of life had not entirely robbed of their
baby-like innocence. The past, sorted thoroughly and quickly by his
memory, shoved out that face before a crowd of others. Five years is
not a long time to remember something unpleasant; he had reasons
to remember that countenance. Knowing the face he also knew that
the man had been, at one time, far from "square." The associations
and means of livelihood during the past five years, judging from the
man's present occupation, had not been the kind to correct any evil
tendency. He laid a forefinger on the edge of the tray. "Start th'
machinery—I 'll risk a couple of dollars, anyhow. That ain't much to
lose. I bet two dollars I can call it right," he said, watching closely.
He won, as he knew he would; and the result told him that the
gambler had not reformed. The dexterous fingers shifting the shells
were slower than others he had seen operate and when he had won
again he stopped, as if to leave. "When I hit town a short time ago I
didn't know I 'd be so lucky. I went an' drawed two months' pay
when I left th' ranch: I shore don't need it. Shuffle 'em again—it's
yore money, anyhow," he laughed. "You should 'a' quit th' game
before you got so slow."
"Goin' back to work purty soon?" queried the shell-man,
wondering how much this "sucker" had left unspent.
"Not me! I 've only just had a couple of drinks since I hit town—
an' I 'm due to celebrate."
The other's face gave no hint of his thoughts, which were that
the fool before him had about a hundred dollars on his person.
"Well, luck's with you today—you 've called it right twice. I 'll bet you
a cool hundred that you can't call it th' third time. It's th' quickness
of my hands agin yore eyes—an' you can't beat me three straight.
Make it a hundred? I hate to play all day."
"I 'll lay you my winnings an' have some more of yore money,"
replied the puncher, feverishly. "Ain't scared, are you?"
"Don't know what it means to be scared," laughed the other.
"But I ain't got no small change, nothin' but tens. Play a hundred an'
let's have some real excitement."
"Nope; eight or nothin'."
He won again. "Now, sixteen even. Come on; I 've got you
beat."
"But what's th' use of stringin' 'long like that?" demanded the
shell-man.
"Gimme a chance to get my hand in, won't you?" retorted the
puncher.
"Well, all right," replied the gambler, and he lost the sixteen.
"Now thirty," suggested the puncher. "Next time all I 've got,
every red cent. Once more to practice—then every red," he
repeated, shifting his feet nervously. "I 'll clean you out an' have a
real, genuine blow-out on yore money. Come on, I 'm in a hurry."
"I 'll fool you this time, by th' Lord!" swore the gambler, angrily.
"You've got more luck than sense. An' I 'll fool you next time, too. Yo
're quicker 'n most men I 've run up agin, but I can beat you, shore
as shootin'. Th' game's square, th' play fair—my hand agin yore eye.
Ready? Then watch me!"
He swore luridly and shoved the money across the board to the
winner, bewailing his slowness and getting angrier every moment.
"Yo 're th' cussedest man I ever bet agin! But I'll get you this time.
You can't guess right all th' time, an' I know it."
"There she is; sixty-two bucks, three score an' two simoleons;
all I 've got, every cent. Let's see you take it away from me!"
The gambler frowned and choked back a curse. He had risked
sixty dollars to win two, and the fact that he had to let this fool play
again with the fire hurt his pride. He had no fear for his money—he
knew he could win at every throw—but to play that long for two
dollars! And suppose the sucker had quit with the sixty!
"Do you get a dollar a month?" he demanded, sarcastically.
"Well, I reckon you earn it, at that. Thought you had money, thought
you drew down two months' pay an' hain't had nothin' more'n two
drinks? Did you go an' lose it on th' way?"
"Oh, I drew it a month ago," replied the sucker, surprised. "I 've
only had two drinks in this town, which I hit 'bout an hour ago. But I
shore lost a wad playin' faro-bank agin a towhead. Come on—lemme
take sixty more of yore money, anyhow."
"Sixty-two!" snapped the proprietor, determined to have those
two miserable dollars and break the sucker for revenge. "Every cent,
you remember."
"All right; I don't care! I ain't no tin-horn," grumbled the other.
"Think I care 'bout two dollars?" But he appeared to be very
nervous, nevertheless.
"Well, put it on th' table."
"After you put yourn down."
"There it is. Now watch me close!" A gleam of joy flashed up in
the angry man's eyes as he played with the shells. "Watch me close!
Mebby it is, an' mebby it ain't—th' game's square, th' play 's fair. It's
my hand agin yore eye. Watch me close!"
"Oh, go ahead! I'm watchin', all right. Think I 'd go to sleep
now!"
The shifting hands stopped, the shells lay quiet, and the
gambler gazed blankly down the unsympathetic barrel of a Colt.
"Now, Thomas, old thimble-rigger," crisply remarked the
supposed sucker as he cautiously slid the money off the table, to be
picked up later when conditions would be more favorable. "Th' little
pea ain't under no shell. Stop! Step back one pace an' elevate them
paws. Don't make no more funny motions with that hand, savvy?
But you can drop th' pea if it hurts them two fingers. Now we 'll see
if I win; I allus like to be shore," and he cautiously turned over the
shells, revealing nothing but the dirty green cloth. "I win; it ain't
there—just like I thought."
"Who are you, an' how 'd you know my name?" demanded the
gambler, mentally cursing his two missing cappers. They were
drinking once too often and things were going to happen in their
vicinity, and very soon.
"Why, you took twenty-five dollars from me up in Alameda onct,
when I could n't afford to lose it," grinned the puncher. "I was
something of a kid then. I remember you, all right. My foreman told
me about yore bang-up fight agin th' Johnson brothers, who gave
you that scar. I thought then that you were a great man—now I
know you ain't. I would n't 'a' played at all if I had n't knowed how
crooked you was. Take yore layout an' yore crookedness, find th' pea
an' yore cappers, an' clear out. An' if anybody asks you if you 've
seen Hopalong Cassidy you tell 'em I 'm up here in Colby makin'
some easy money beatin' crooked games. So-long, an' don't look
back!"
Hopalong watched him go and then went to the nearest place
where he could get something to eat. In due time, having disposed
of a square meal, Hopalong called for a drink and a cigar, and sat
quietly smoking for nearly half an hour, so lost in thought that his
cigar went out repeatedly. As he reviewed his disastrous play at faro
many small details came to him and now he found them interesting.
The dealer was not a master at his trade and Hopalong had seen
many better; in fact the man was not even second class, and this
fact hurt his pride. He had played a careful game, and the great
majority of his small bets had won—it was only when he risked
twenty or thirty dollars that he lost. The only big bet that he had
been at all lucky on was one where doubles showed on the turn and
he had been split, losing half of his stake. But when he had played
his last fifty dollars on the Jack, open, the final blow fell and he had
left the table in disgust.
Why weren't there cue-cards, so the players could keep their
own tally of the cards instead of having to depend on the cue-box
kept by the case-keeper? This made him suspicious; a crooked
dealer and case-keeper can trim a big bet at will, unless the players
keep their own cases or are exceptionally wise; and even then a
really good dealer will get away with his play nine times out of ten.
While he seldom played a system, he had backed one that morning;
but he was cured of that weakness now. If the game were square he
figured he could get at least an even break; if crooked, nothing but a
gun could beat it, and he had a very good gun. When he thought of
the gun, he reviewed the arrangement of the room and estimated
the weight of the rough, deal table on which rested the faro layout.
He smiled and turned to the bartender. "Hey, barkeeper! Got any
paper an' a pencil?"
After some rummaging the taciturn dispenser of liquid forget-it
produced the articles in question and Hopalong, drawing some
hurried lines, paid his bill, treated, kept the pencil and headed for
the faro game across the street.
When he entered the room the table was deserted and he
nodded to the dealer as he seated himself at the right of the case-
keeper, who now took his place, and opposite the dealer and the
lookout. He was not surprised to find no other players in the room,
for the hour was wrong; later in the afternoon there would be many
and at night the place would be crowded. This suited him perfectly
and he settled himself to begin playing.
When the deck was shuffled and placed in the deal box
Hopalong put his ruled paper in front of him on the table, tallied
once against the King for the soda card and started to play quarters
and half dollars. He caught the fugitive look that passed between the
men as they saw his cue-card but he gave no sign of having
observed it. After that he never looked up from the cards while his
bets were small. Two deals did not alter his money much and he
knew that so far the game was straight. If it were not to remain
straight the crookedness would not come more than once in a deal if
the frame-up was "single-odd" and then not until the bet was large
enough to practically break him. His high-card play ran in his favor
and kept him gradually drawing ahead. He lost twice in calling the
last turn and guessed it right once, at four to one, which made him
win in that department of the game.
When the fifth deal began he was quite a little ahead and his
play became bolder, some of the bets going as high as ten dollars.
He broke even and then played heavier on the following deal. His
first high bet, twenty dollars, was on the eight, open, only one eight
having shown. Double eights showed on the next turn and he was
split, losing half the stake.
It was about this time that the look-out discovered that Mr.
Cassidy was getting a little excited and several times had nearly
forgotten to keep his cases. This information was cautiously passed
to the dealer and case-keeper and from then on they evinced a little
more interest in the game. Finally the player, after studying his cue-
card, placed fifty dollars on the Queen, open, and coppered the
deuce, a case-card, and then put ten more on the high card. This
came in the middle of the game and he was prepared for trouble as
the turn was made, but fortune was kind to him and he raked in
sixty dollars. He was mildly surprised that he had won, but explained
it to himself by thinking that the stakes were not yet high enough.
From then on he was keenly alert, for the crookedness would come
soon if it ever did, but he strung small sums on the next dozen turns
and waited for a new deal before plunging.
As the dealer shuffled the cards the door opened and closed
noisily and a surprised and doubting voice exclaimed: "Ain't you
Hopalong Cassidy? Cassidy, of th' Bar-20?"
Hopalong glanced up swiftly and back to the cards again: "Yes;
what of it?"
"Oh, nothin'. I saw you onct an' I wondered if I was right."
"Ain't got time now; see you later, mebby. You might stick
around outside so I can borrow some money if I go broke." The man
who knew Mr. Cassidy silently faded, but did not stick around,
thereby proving that the player knew human nature and also how to
get rid of a pest.
When the dealer heard the name he glanced keenly at the
owner of it, exchanged significant looks with the case-keeper and
faltered for an instant as he shoved the cards together. He was not
sure that he had shuffled them right, and an anxious look came into
his eyes as he realized that the deal must go on. It was far from
reassuring to set out to cheat a man so well known for expert short-
gun work as the Bar-20 puncher and he wished he could be relieved.
There was no other dealer around at that time of the day and he
had to go through with it. He did not dare to shuffle again and
chance losing the card beyond hope, and for the reason that the
player was watching him like a hawk.
A ten lay face up on the deck and Hopalong, tallying against it
on his sheet, began to play small sums. Luck was variable and
remained so until the first twenty dollar bet, when he reached out
excitedly and raked in his winnings, his coat sleeve at the same time
brushing the cue-card off the table. But he had forgotten all about
the tally sheet in his eagerness to win and played several more cards
before he noticed it was missing and sought for it. Smothering a
curse he glanced at the case-keeper's tally and went on with the
play. He did not see the look of relief that showed momentarily on
the faces of the dealer and his associates, but he guessed it.
He had no use for cue-cards when he felt like doing without
them; he liked to see them in use by the players because it showed
the game to be more or less straight, and it also saved him from
over-heating his memory. When he had brushed his tally sheet off
the table he knew what he was doing, and he knew every card that
had been drawn out of the box. So far he had seen no signs of
cheating and he wished to give the dealer a chance. There should
now remain in the deal box three cards, a deuce, five and a four,
with a Queen in sight as the last winner. He knew this to be true
because he had given all his attention to memorizing the cards as
they showed in the deal box, and had made his bets small so he
would not have to bother about them. As he had lost three times on
a four he now believed it was due to win.
Taking all his money he placed it on the four: "Two hundred and
seventy on th' four to win," he remarked, crisply.
The dealer sniffed almost inaudibly and the case-keeper
prepared to cover him on the cue-rack under cover of the
excitement of the turn. If the four lay under the Queen, Cassidy lost;
if not he either won or was in hock. The dealer was unusually grave
as he grasped the deal box to make the turn and as the Queen slid
off a five-spot showed.
The dealer's hand trembled as he slid the five off, showing a
four, and a winner for Hopalong. He went white—he had bungled the
shuffle in his indecision and now he did n't know what might
develop. And in his agitation he exposed the hock card before he
realized what he was doing, and showed another five. He had made
the mistake of showing the "odd."
Hopalong, ready for trouble, was more prepared than the others
and he was well under way before they started. His left hand swung
hard against the case-keeper's jaw, his Colt roared at the drawing
bartender, crumpling the trouble-hunter into a heap on the floor
dazed from shock of a ball that "creased" his head. He had done this
as he sprang to his feet and his left hand, dropping swiftly to the
heavy table, threw it over onto the lookout and the dealer at the
instant their hands found their guns. Caught off their balance they
went down under it and before they could move sufficiently to do
any damage, Hopalong vaulted the table and kicked their guns out
of their hands. When they realized just what had happened a still-
smoking Colt covered them. Many of Hopalong's most successful and
spectacular plays had been less carefully thought out beforehand
than this one and he laughed sneeringly as he looked at the men
who had been so greedy as to try to clean him out the second time.
"Get up!" he snarled.
They crawled out of their trap and sullenly obeyed his hand,
backing against the wall. The case-keeper was still unconscious and
Hopalong, disarming him, dragged him to the wall with the others.
"I wondered where that deuce had crawled to," Mr. Cassidy
remarked, grimly, "an' I was goin' to see, only it's plain now. I
knowed you was clumsy, but my G—d! Any man as can't deal 'single-
odd' ought to quit th' business, or play straight. So you had five fives
agin me, eh? Instead of keepin' th' five under th' Queen, you
bungled th' deuce in its place. When you went to pull off th' Queen
an' five like they was one card, you had th' deuce under her. You
see, I keep cases in my old red head an' I did n't have to believe
what th' cue-rack was all fixed to show me. An' I was waitin', all
ready for th' play that 'd make me lose.
"As long as this deal was framed up, we 'll say it was this
mornin'. You cough up th' hundred an' ten I lost then, an' another
hundred an' ten that I 'd won if it was n't crooked. An' don't forget
that two-seventy I just pulled down, neither. Make it in double
eagles an' don't be slow 'bout it. Money or lead—with you callin' th'
turn." It was not a very large amount and it took only a moment to
count it out. The eleven double eagles representing the mornin's
play seemed to slide from the dealer's hand with reluctance—but a
man lives only once, and they slid without stopping.
The winner, taking the money, picked up the last money he had
bet and, distributing it over his person to equalize the weight,
gathered up the guns from the floor. Backing toward the door he
noticed that the bartender moved and a keen glance at that
unfortunate assured him that he would live.
When he reached the door he stopped a moment to ask a
question, the tenseness of his expression relaxing into a broad,
apologetic grin. "Would you mind tellin' me where I can find some
more frame-ups? I shore can use th' money."
The mumbled replies mentioned a locality not to be found on
any map of the surface of the globe, and grinning still more broadly,
Mr. Cassidy side-stepped and disappeared to find his horse and go
on his way rejoicing.

VIII
THE NORTHER

Johnny knew I had a notebook crammed with the stories his friends
had told me; but Johnny, being a wise youth, also knew that there
was always room for one more. Perhaps that explains his sarcasm,
for, as he calmly turned his back on his fuming friend, he winked at
me and sauntered off, whistling cheerfully.
Red spread his feet apart, jammed his fists against his thighs
and stared after the youngster. His expression was a study and his
open mouth struggled for a retort, but in vain. After a moment he
shook his head and slowly turned to me. "Hear th' fool? He 's from
Idyho, he is. It never gets cold nowhere else on earth. Ain't it
terrible to be so ignorant?" He glanced at the bunkhouse, into which
Johnny had gone for dry clothing. "So I ain't never seen no cold
weather?" he mused thoughtfully. Snapping his fingers irritably, he
wheeled toward the corral. "I 'm goin' down to look at th' dam—
there 's been lots of water leanin' ag'in it th' last week. Throw th'
leather on Saint, if you wants, an' come along. I 'll tell you about
some cold weather that had th' Idyho brand faded. Cold weather!
Huh!"
As he swung past the bunkhouse we saw Johnny and Billy
Jordan leaning in the doorway ragging each other, as cubs will.
Johnny grinned at Red and executed a one-hand phrase of the sign
language that is universally known, which Red returned with a
chuckle. "Wish he 'd been here th' time God took a hand in a big
game on this ranch," he said. "I 'm minus two toes on each foot in
consequence thereof. They can't scare me none by preachin' a red-
hot hell. No, sir; not any."
He was silent a moment. "Mebby it ain't so bad when a feller is
used to it; but we ain't. An' it frequent hits us goin' over th' fence,
with both feet off th' ground. Anyhow, that Norther was n't no storm
—it was th' attendant agitation caused by th' North Pole visitin' th'
Gulf.
"Cowan had just put Buckskin on th' map by buildin' th' first
shack. John Bartlett an' Shorty Jones, d—n him, was startin' th'
Double Arrow with two hundred head. When th' aforementioned
agitation was over they had less 'n one hundred. We lost a lot of
cows, too; but our range is sheltered good, an' that rock wall down
past Meeker's bunkhouse stopped our drifts, though lots of th' cows
died there.
"We 'd had a mild winter for two weeks, an' a lot of rain. We
was chirpin' like li'l fool birds about winter bein' over. Ever notice
how many times winter is over before it is? But Buck did n't think so;
an' he shore can smell weather. We was also discussin' a certain
campin' party Jimmy had discovered across th' river. Jimmy was at
th' bunkhouse that shift an' he was a great hand for snoopin' around
kickin' up trouble. He reports there's twelve in th' party an' they 're
camped back of Split Hill. Now, Split Hill is no place for a camp, even
in th' summer; an' what got us was th' idea of campin' at all in th'
winter. It riled Buck till he forgot to cross off three days on th'
calendar, which we later discovered by help of th' almanac an' th'
moon. Buck sends Hoppy over to scout around Split Hill. You know
Hoppy. He scouted for two days without bein' seen, an' without
discoverin' any lawful an' sane reason why twelve hard-lookin' fellers
should be campin' back of Split Hill in th' winter time. He also found
they had come from th' south, an' he swore there was n't no cow
tracks leadin' toward them from our range. But there was lots of
hoss tracks back and forth. An' when he reports that th' campers
had left an' gone on north we all feel better. Then he adds they
turned east below th' Double Arrow an' went back south again.
That's different. It's plain to some of us they was lookin' us over for
future use; learnin' our ways an' th' lay of th' land. There was seven
of us at th' time, but we could 'a' licked 'em in a fair fight.
"In them days we only had two line houses. Number One was
near Big Coulee, with Cowan's at th' far end of its fifteen miles of
north line; th' west line was a twenty-five-mile ride south to Lookout
Peak. Number Two was where th' Jumpin' Bear empties into th' river,
now part of Meeker's range. From it th' riders went west twenty-five
miles to th' Peak an' north from it twenty-five miles along th' east
line. There was a hundred thousan' acres in Conroy Valley an' thirty
thousan' in th' Meeker triangle, which made up Section Two. At that
time mebby ten thousan' cows was on this section—two-thirds of all
of 'em. When we built Number Three on th' Peak this section was
cut down to a reasonable size. Th' third headquarters then was th'
bunkhouse, with only th' east line to ride. One part, th' shortest, ran
north to Cowan's; th' other run about seventeen miles south to Li'l
Timber, where th' line went on as part of Number Two's. We paired
off an' had two weeks in each of 'em in them days.
"When we shifted at th' end of that week Jimmy Price an' Ace
Fisher got Number One; Skinny an' Lanky was in Number Two; an'
me an' Buck an' Hoppy took life easy in th' bunkhouse, with th' cook
to feed us. Buck, he scouted all over th' ranch between th' lines an'
worked harder than any of us, spendin' his nights in th' nearest
house.
"One mornin', about a week after th' campers left, Buck looked
out of th' bunkhouse door an' cautions me an' Hoppy to ride
prepared for cold weather. I can see he 's worried, an' to please him
we straps a blanket an' a buffalo robe behind our saddles, cussin' th'
size of 'em under our breath. I 've got th' short ride that day, an'
Buck says he 'll wait for me to come back, after which we 'll scout
around Medicine Bend. He 's still worried about them campers. In th'
Valley th' cows are thicker 'n th' other parts of th' range, an' it would
n't take no time to get a big herd together. He 's got a few things to
mend, so he says he 'll do th' work before I get back.
"Down on Section Two things is happenin' fast, like they mostly
do out here. Twelve rustlers can do a lot if they have things planned,
an' 'most any fair plan will work once. They only wanted one day—
after that it would be a runnin' fight, with eight or nine of 'em layin'
back to hold us off while th' others drove th' cows hard. Why,
Slippery Trendley an' Tamale Jose was th' only ones that ever slid
across our lines with that many men.
"Three rustlers slipped up to Number Two at night an' waited.
When Skinny opened th' door in th' mornin' he was drove back with
a hole in his shoulder. Then there was h—l a-poppin' in that li'l mud
shack. But it did n't do no good, for neither of 'em could get out
alive until after dark. They learned that with sorrow, an' pain. An'
they shore was het up about it. Ace Fisher, ridin' along th' west line
from Number One, was dropped from ambush. Two more rustlers lay
back of Medicine Bend lookin' for any of us that might ride down
from the bunkhouse. An' they sent two more over to Li'l Timber to
lay under that ledge of rock that sticks out of th' south side of th'
bluff like a porch roof. Either me or Hoppy would be ridin' that way.
They stacked th' deck clever; but Providence cut it square.
"Th' first miss-cue comes when a pert gray wolf lopes past
ahead of Hoppy when he 's quite some distance above Li'l Timber.
This gray wolf was a whopper, an' Hoppy was all set to get him. He
wanted that sassy devil more 'n he wanted money just then, so he
starts after it. Mr. Gray Wolf leads him a long chase over th' middle
of th' range an' then suddenly disappears. Hoppy hunts around quite
a spell, an' then heads back for th' line. While he's huntin' for th'
wolf it gets cold, an' it keeps on gettin' colder fast.
"Me, I leaves later 'n usual that mornin'. An' I don't get to
Cowan's until late. I 'm there when I notices how cussed cold it's got
all of a sudden. Cowan looks at his thermometer, which Jimmy later
busts, an' says she has gone down thirty degrees since daylight. He
gives me a bottle of liquor Buck wanted, an' I ride west along th'
north line, hopin' to meet Jimmy or Ace for a short talk.
"All at once I notice somebody 's pullin' a slate-covered blanket
over th' north sky, an' I drag my blanket out an' wrap it around me. I
'm gettin' blamed cold, an' also a li'l worried. Shall I go back to
Cowan's or head straight for th' bunkhouse? Cowan's the nearest by
three miles, but what's three miles out here? It's got a lot colder
than it was when I was at Cowan's, an' while I 'm debatin' about it
th' wind dies out. I look up an' see that th' slate-covered blanket has
traveled fast. It's 'most over my head, an' th' light is gettin' poor.
When I look down again I notice my cayuses's ears movin' back an'
forth, an' he starts pawin' an' actin' restless. That settles it. I 'm
backin' instinct just then, an' I head for home. I ain't cussin' that
blanket none now, an' I 'm glad I got th' robe handy; an' that quart
of liquor ain't bulky no more.
"All at once th' bottom falls out of that lead sky, an' flakes as big
as quarters sift down so fast they hurts my eyes, an' so thick I can't
see twenty feet. In ten minutes everythin' is white, an' in ten more I
'm in a strange country. My hands an' feet ache with cold, an' I 'm
drawin' th' blanket closer, when there 's a puff of wind so cold it cuts
into my back like a knife. It passes quick, but it don't fool me. I
know what's behind it. I reach for th' robe an' has it 'most
unfastened when there 's a roar an' I 'm 'most unseated by th' wind
before I can get set. I did n't know then that it's goin' to blow that
hard for three days, an' it's just as well. It's full of ice—li'l slivers that
are sharp as needles an' cut an' sting till they make th' skin raw. I let
loose of th' robe an' tie my bandanna around my face, so my nose
an' mouth is covered. My throat burns already almost to my lungs.
Good Lord, but it is cold! My hands are stiff when I go back for th'
robe, an' it's all I can do to keep it from blowin' away from me. It
takes me a long time to get it over th' blanket, an' my hands are
'most froze when it's fastened. That was a good robe, but it did n't
make much difference that day. Th' cold cuts through it an' into my
back as if it was n't there. My feet are gettin' worse all th' time, an' it
ain't long before I ain't got none, for th' achin' stops at th' ankles.
Purty soon only my knees ache, an' I know it won't be long till they
won't ache no more.
"I 'm squirmin' in my clothes tryin' to rub myself warm when I
remember that flask of liquor. Th' cork was out far enough for my
teeth to get at it, an' I drink a quarter of it quick. It's an awful load—
any other time it would 'a' knocked me cold, for Cowan sold a lot
worse stuff then than he does now. But it don't phase me, except for
takin' most of th' linin' out of my mouth an' throat. It warms me a
li'l, an' it makes my knees ache a li'l harder. But it don't last long—th'
cold eats through me just as hard as ever a li'l later, an' then I begin
to see things an' get sleepy. Cows an' cayuses float around in th' air,
an' I 'm countin' money, piles of it. I get warm an' drowsy an' find
myself noddin'. That scares me a li'l, an' I fight hard ag'in it. If I go
to sleep it's all over. It keeps gettin' worse, an' I finds my eyes
shuttin' more an' more frequent, an' more an' more frequent thinkin'
I don't care, anyhow. An' so I drifts along pullin' at th' bottle till it's
empty. That should 'a' killed me, then an' there—but it don't even
make me real drunk. Mebby I spilled some of it, my hands bein'
nothin' but sticks. I can't see more 'n five feet now, an' my eyes
water, which freezes on 'em. I 've given up all hope of hearin' any
shootin'. So I close th' peekhole in th' blanket an' robe, drawin' 'em
tight to keep out some of th' cold. I am sittin' up stiff in th' saddle,
like a soldier, just from force of habit, and after a li'l while I don't
know nothin' more. Pete says I was a corpse, froze stiff as a ramrod,
an' he calls me ghost for a long time in fun. But Pete was n't none
too clear in his head about that time.
"Down at Li'l Timber, Hoppy managed to get under th' shelter of
that projectin' ledge of rock on th' south side of th' bluff. Th' snow
an' ice is whirlin' under it because of a sort of back draft, but th'
wind don't hit so hard. He 's fightin' that cayuse every foot, tryin' to
get to th' cave at th' west end, an' disputin' th' right of way with th'
cows that are packed under it.
There 's firewood under that ledge an' there 's food on th' hoof,
an' snow water for drink; so if he can make th' cave he 's safe. He 's
more worried about his supply of smokin' tobacco than anythin' else,
so far as he 's concerned.
"All at once he runs onto four men huddled half-froze in a bunch
right ahead of him. He knows in a flash who they are, an' he draws
fumblingly, an' holds th' gun in his two hands, they are so cold. One
clean hit an' five clean misses in twenty feet! They're gropin' for
their guns when a sudden gust of wind whirls down from th' top of
th' hill, pilin' snow an' ice on 'em till they can't see nor breathe. An' a
couple of old trees come down to make things nicer. Hoppy is
blinded, an' when he gets so he can see again there's one rustler's
arm stickin' up out of th' snow, but no signs of th' other three. They
blundered out into th' open tryin' to get away from th' stuff comin'
down on 'em, an' that means they won't be back no more.
"Hoppy manages to get to th' cave, tie his cayuse to a fallen
tree, an' gather enough firewood for a good blaze, which he puts in
front of th' cave. It takes him a long time to use up his matches one
by one, an' then he pulls th' lead out of a cartridge with his teeth,
shakes th' powder loose in it an' along th' barrel. Usin' his cigarette
papers for tinder he gets th' fire started an' goin' good an' is feelin'
some cheerful when he remembers th' three rustlers driftin' south.
They was bound to hit a big arroyo that would lead 'em almost ag'in'
Number Two's door. With th' wind drivin' 'em straight for it, Hoppy
thinks it might mean trouble for Lanky or Skinny. He did n't think
about 'em only havin' wool-lined slickers on, or he 'd 'a' knowed they
couldn't live till they got halfway. They left their blankets in camp so
they could work fast.
"People have called us clannish, an' said we was a lovin' bunch'
because we stick together so tight. We 've faced so much together
that us of th' old bunch has got th' same blood in our veins. We ain't
eight men—we 're one man in eight different kinds of bodies. G—d
help anybody that tries to make us less! It's one thing to stand up
an' swap shots with a gunman; but it's another to turn yore back on
a cave an' a fire like that an' go out into what is purty nigh shore
death on a long chance of helpin' a couple of friends that was able
to take care of themselves. That's one of th' things that explains why
we made Shorty Jones an' his eleven men pay with their lives for
takin' Jimmy's life. Twelve for one! That fight at Buckskin ain't
generally understood, even by our friends. An' Hoppy crowns his
courage twice in that one storm. Ain't he an old son-of-a-gun?
"He leaves that fire an' forces his cayuse to take him out in th'
storm again, finds that th' arroyo is level full of snow, but has both
banks swept bare. He passes them three rustlers in th' next ten
minutes—they won't do no more cow-liftin'. Then he tries to turn
back, but that's foolish. So he drifts on, gettin' a li'l loco by now. He
's purty near asleep when he thinks he hears a shot. He fights his
cayuse again, but can't stop it, so he falls off an' lets it drift, an'
crawls an' fights his way back to where that shot was fired from. G—
d only knows how he does it, but he falls over a cow an' sees Lanky
huggin' its belly for th' li'l warmth in th' carcass. An' he ought to 'a'
found him, after leavin' his cayuse an' turnin' back on foot in that h
—l storm! Th' drifts was beginnin' to make then—when th' storm
was over I saw drifts thirty feet high in th' open; an' in th' valley
there was some that run 'most to th' top of th' bluffs, an' they're
near sixty feet high.
"Well, Lanky is as crazy as him, an' won't let go of that cow, an'
they have a fight, which is good for both of 'em. Finally Lanky gets
some sense in his head an' realizes what Hoppy is tryin' to do for
him, an' they go staggerin' down wind, first one fallin' an' then th'
other. But they keep fightin' like th' game boys they are, neither
givin' a cuss for himself, but shore obstinate that he 's goin' to get
th' other out of it. That's our spirit; an' we 're proud of it, by G—d!
Hoppy wraps th' robe around Lanky, an' so they stagger on, neither
one knowin' very much by that time. Th' Lord must 'a' pitied that
pair, an' admired th' stuff He 'd put in 'em, for they bump into th' line
house kerslam, an' drop, all done an' exhausted.
"Meanwhile Skinny's hoppin' around inside, prayin' an' cussin' by
streaks, every five minutes openin' th' door an' firm' off his Colt. He
has tied th' two ropes together, an' frequent he ties one end to th'
door, th' other to hisself, an' goes out pokin' around in th' snow,
hopin' to stumble over his pardner. He 's plumb forgot his bad
shoulder long ago. Purty soon he opens th' door again to shoot off
th' gun, an' in streaks somethin' between his laigs. He slams th' door
as he jumps aside, an' then looks scared at Lanky's sombrero!
Mebby he's slow hoppin' outside an' diggin' them out of th' drift
that's near covered 'em! Now, don't think bad of Skinny. He dass n't
leave th' house to search any distance, even if he could 'a' seen
anythin'. His best play is to stick there an' shoot off his gun—Lanky
might drift past if he was not there to signal. Skinny thought more of
Lanky any time than he did of hisself, th' emaciated match!
"It don't take long to kick in a lot of snow with that wind blowin'
an' he rubs them two till he 's got tears in his eyes. Then he fills 'em
with hot stew an' whisky, rolls 'em up together an' heaves 'em in th'
same bunk. It ain't warm enough in that house, even with th' fire
goin', to make 'em lose no arms or laigs.
"It seems that Lanky, watchin' his chance as soon as th' snow
fell heavy enough to cover his movements, slipped out of th' house
an' started to circle out around them festive rustlers that held him
an' his friend prisoners. He made Skinny stay behind to hold th'
house an' keep a gun poppin'. Lanky has worked up behind where
th' rustlers was layin' when th' Norther strikes full force. It near
blows him over, an', not havin' on nothin' but an old army overcoat
that was wore out, th' cold gets him quick. He can't see, an' he can't
hear Skinny's shots no more! He does th' best he can an' tries to
fight back along his trail, but in no time there ain't no tracks to
follow. Then he loses his head an' starts wanderin' until a cow
blunders down on him. He shoots th' cow an' hugs its belly to keep
warm an' then he don't really remember nothin' 'till he wakes up in
th' bunk alongside of Hoppy, both gettin' over an awful drunk.
Skinny kept feedin' liquor to 'em till it was gone, an' he had a plenty
when he began.
"Jimmy Price was at Number One when th' blow started, an'
Buck was in th' bunkhouse, an' it was three weeks before they could
get out an' around, on account of th' snow fallin' so steady an' hard
they could n't see nothin'.
"Well, getting back to me explains how Pete Wilson came to th'
Bar-20. He is migratin' south, just havin' had th' pleasure of learnin'
that his wife sloped with a better-lookin' man. He was scared she
might get tired of th' other feller an' sift back, so he sells out his li'l
store, loads a waggin with blankets, grub, an' firewood, an' starts
south, winter or no winter. He moves fast for a new range, where he
can make a new beginnin' an' start life fresh, with five years of
burnin' matrimonial experience as his valuablest asset. Pete says he
reckoned mebby he would n't have so many harness sores if he run
single th' rest of his life; heretofore he 'd been so busy applyin' salve
that he did n't have time to find out just what was th' trouble with
th' double harness. Lots of men feel that way, but they ain't got
Pete's unlovely outspoken habit of thought. We used to reckon
mebby he was n't as smart as th' rest of us, him bein' slow an'
blunderin' in his retorts. We 've played that with coppers lots of
times since, though. While he ain't what you 'd call quick at retortin',
his retorts usually is heard by th' whole county. It ain't every collar-
galled husband that's got th' gumption or smartness to jump th'
minute th' hat is lifted. Pete had.
"He's drivin' across our range, an' when th' wind dies out
sudden an' th' snow sifts down, he 's just smart enough to get out
his beddin' an' wrap it around him till he looks like a bale of cotton.
An' even at that he 's near froze an' lookin' for a place to make a
stand when he feels a bump. It's me, fallin' off my cayuse, against
his front wheel. He emerges from his beddin', lifts me into th'
waggin, puts most of his blankets around me, an' stops. Knowin' he
can't save th' cayuses, he shoots 'em. That means grub for us,
anyhow, if we run short of th' good stuff. Nobody but Pete could 'a'
got th' canvas off that waggin in such a gale, but he did it. He busts
th' arches an' slats off th' top of th' waggin an' uses 'em for
firewood. Th' canvas he drapes over th' box, lettin' it hang down on
both sides to th' ground. An' in about five minutes th' whole thing
was covered over with snow. Pete 's the strongest man we ever saw,
an' we 've seen some good ones. Wrastlin' that canvas with stiff
hands was a whole lot more than what he done to Big Sandy up
there on Thunder Mesa.
"Pete says I was dead when he grabbed me, an' smellin'
disgraceful of liquor. But th' first thing I know is lookin' up in th'
gloom at a ceilin' that's right close to my head, an' at a sorta rafter.
That rafter gives me a shock. It don't even touch th' ceilin', but runs
along 'most a foot below it. I close my eyes an' do a lot of thinkin'. I
remember freezin' to death, but that's all. An' just then I hears a
faint voice say: 'He shore was dead.' I don't know Pete then, or that
he talked to hisself sometimes. An' I reckon I was a li'l off in my
head, at that. I begin to wonder if he means me, an' purty soon I 'm
shore of it. An' don't I sympathize with myself? I 'm dead an' gone
somewhere; but no preacher I ever heard ever described no place
like this. Then I smell smoke an' burnin' meat—which gives me a
clew to th' range I 'm on. Mebby I 'm shelved in th' ice box, waitin'
my turn, or somethin'. I knew I 'd led a sinful life. But there wasn't
no use of rubbin' it in—it's awful to be dead an' know it.
"Th' next time I opens my eyes I can't see nothin'; but I can
feel somethin' layin' alongside of me. It's breathin' slow an' regular,
an it bothers me till I get th' idea all of a sudden. It's another dead
one, cut out of th' herd an' shoved in my corral to wait for
subsequent events. I felt sorry for him, an' lay there tryin' to figger it
out, an' I 'm still figgerin' when it starts to get light. Th' other feller
grunts an' sits up, bumpin' his head solid against that fool rafter. No
dead man that was shoved in a herd consigned to heaven ever used
such language, which makes me all the shorer of where I am. But if
hell's hot we 've still got a long way to go.
"He sits there rubbin' his head an' cussin' steadily, an' I 'm so
moved by it that I compliments him. He jumps an' bumps his head
again, an' looks at me close. 'D—d if you ain't a husky corpse,' he
says. That settles it. I ain't crazy, like I was hopin', but I 'in dead.
'You an' me is on th' ragged edge of h—l,' he adds.
"'But who tipped you off?' I asks. 'They just shoved me in here
an' did n't tell me nothin' at all.'
"'Crazy as th' devil,' he grunts, lookin' at me harder.
"'Yo 're a liar,' I replies. 'I may be dead, but d—d if I 'm crazy!'
"'An' I don't blame you, either,' he mused, sorrowful. 'Now you
keep quiet till I gets somethin' to eat,' an' he crawls into a li'l round
hole at th' other end of th' room.
"Purty soon I smell smoke again, an' after a long time he comes
back with some hot coffee an' burned meat. I grab for th' grub, an'
while I 'm eatin' I demands to know where I am.
"He laughs, real cheerful, an' tells me. I 'm under his waggin,
surrounded by canvas an' any G—d's quantity of snow. Th' drift over
us is fifteen foot high, th' wind has died down, an' it's still snowin' so
hard he can't see twenty feet. It is also away down below freezin'.
"We stayed under that drift 'most three weeks, livin' on raw
meat after our firewood gave out. We didn't suffer none from th'
cold, though, under all that snow an' with all th' blankets we had.
When it stopped snowin' we discovered a drift shamefully high about
a mile northeast of us, an' from th' smoke comin' out of it I knew it
was th' bunkhouse.
"Well, to cut it short, it was. An' mebby Buck wasn't glad to see
me! He was worried 'most sick an' as soon as we could, we got
cayuses and started out to look for th' others, scared stiff at what
we expected to find."
He paused and was silent a moment. "But only Ace was
missin'," he added. "We found him an' th' rustlers later, when th'
snow went off."
He paused again and shook his head. "It shore was a miracle
that we did n't go with 'em, all of us, except Buck. Pete was so
plumb disgusted with travelin' in th' winter, an' had lost his cayuses,
that when Buck offers him Ace's bunk he stays. An' he ain't never
left us since. Huh! Cold? That cub don't know nothin'—mebby he will
when he grows up, but I dunno, at that. Idyho!"

IX
THE DRIVE
The Norther was a thing of the past, but it left its mark on Buck
Peters, whose grimness of face told what the winter had been to
him. His daily rides over the range, the reports of his men since that
deadly storm had done a great deal to lift the sagging weight that
rested on his shoulders; but he would not be sure until the round-up
supplied facts and figures.
That the losses had not been greater he gave full credit to the
valley with its arroyos, rock walls, draws, heavily grassed range and
groves of timber; for the valley, checking the great southward drift
by its steep ridges of rock, sheltered the herds in timber and arroyos
and fed them on the rich profusion of its grasses, which, by some
trick of the rushing winds, had been whirled clean of snow.
But over the cow-country, north, east, south and west, where
vast ranges were unprotected against the whistling blasts from the
north, the losses had been stupendous, appalling, stunning. Outfits
had been driven on and on before the furious winds, sleepy and
apathetic, drifting steadily southward in the white, stinging shroud to
a drowsy death. Whole herds, blindly moving before the wind, left
their weaker units in constantly growing numbers to mark the trail,
and at last lay down to a sleep eternal. And astonishing and
incredible were the distances traveled by some of those herds.
Following the Norther came another menace and one which
easily might surpass the worst efforts of the blizzard. Warm winds
blew steadily, a hot sun glared down on the snow-covered plain and
then came torrents of rain which continued for days, turning the
range into a huge expanse of water and mud and swelling the
water-courses with turgid floods that swirled and roared above their
banks. Should this be quickly followed by cold, even the splendid
valley would avail nothing. Ice, forming over the grasses, would
prove as deadly as a pestilence; the cattle, already weakened by the
hardships of the Norther, and not having the instinct to break
through the glassy sheet and feed on the grass underneath, would
search in vain for food, and starve to death. The week that followed
the cessation of the rains started gray hairs on the foreman's head;
but a warm, constant sun and warm winds dried off the water before
the return of freezing weather. The herds were saved.
Relieved, Buck reviewed the situation. The previous summer
had seen such great northern drives to the railroad shipping points
in Kansas that prices fell until the cattlemen refused to sell. Rather
than drive home again, the great herds were wintered on the Kansas
ranges, ready to be hurled on the market when Spring came with
better prices. Many ranches, mortgaged heavily to buy cattle, had
been on the verge of bankruptcy, hoping feverishly for better prices
the following year. Buck had taken advantage of the situation to
stock his ranch at a cost far less than he had dared to dream. Then
came the Norther and in the three weeks of devastating cold and
high winds the Kansas ranges were swept clean of cattle, and even
the ranges in the South were badly crippled. Knowing this, Buck also
knew that the following Spring would show record high prices. If he
had the cattle he could clean up a fortune for his ranch; and if his
herd was the first big one to reach the railroad at Sandy Creek it
would practically mean a bonus on every cow.
Under the long siege of uncertainty his impatience smashed
through and possessed him as a fever and he ordered the calf
round-up three weeks earlier than it ever had been held on the
ranch. There was no need of urging his men to the task—they, like
himself, sprang to the call like springs freed from a restraining
weight, and the work went on in a fever of haste. And he took his
place on the firing line and worked even harder than his outfit of
fanatics.
One day shortly after the work began a stranger rode up to him
and nodded cheerfully. "Li'l early, ain't you?" Buck grunted in reply
and sent Skinny off at top speed to close a threatened gap in the
lengthy driving line. "Goin' to git 'em on th' trail early this year?"
persisted the stranger. Buck, swayed by some swift intuition,
changed his reply. "Oh, I dunno; I 'm mainly anxious to see just
what that storm did. An' I hate th' calf burnin' so much I allus like to
get it over quick." He shouted angrily at the cook and waved his
arms frantically to banish the chuck wagon. "He can make more
trouble with that waggin than anybody I ever saw," he snorted. "Get
out of there, you fool!" he yelled, dashing off to see his words
obeyed. The cook, grinning cheerfully at his foreman's language and
heat, forthwith chose a spot that was not destined to be the center
of the cut-out herd. And when Buck again thought of the stranger he
saw a black dot moving toward the eastern skyline.
The crowded days rolled on, measured full from dawn to dark,
each one of them a panting, straining, trying ordeal. Worn out, the
horses were turned back into the temporary corral or to graze under
the eyes of the horse wranglers, and fresh ones took up their work;
and woe unto the wranglers if the supply fell below the demand. For
the tired men there was no relief, only a shifting in the kind of work
they did, and they drove themselves with grave determination, their
iron wills overruling their aching bodies. First came the big herds in
the valley; then, sweeping north, they combed the range to the
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!

ebookball.com

You might also like