Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VBA book for undergrad engineers

Status
Not open for further replies.

JTBorton

Technical User
Jun 9, 2008
345
DE
I'm trying to put together a VBA course to teach engineering undergrads 1) how to program, and 2) how to use excel to solve engineering problems.

Most of the books I'm finding seem to race through the fundamentals of programming VBA so they can teach the really deep stuff. I'm looking for one that goes more into depth on the fundamentals. Most don't even know what variables are. They can learn the more complicated stuff on their own time in the field. I would also like to see an excellent reference section which tabulates all the functions, objects, properties, etc, so that they could look things up as they work through it. I chose Excel VBA because as engineers they will probably never have need for, nor be exposed to the full VB programming environment.

So far I've narrowed it down to two books that do a quasi-moderate, almost acceptable job of teaching fundamentals:
Excel 2007 Power Programming with VBA by John Walkenbach
Programming Excel with VBA and .NET by Jeff Webb

Can anyone recommend a VBA book that does a really good job of teaching programming fundamentals?

Also, would it be appropriate to introduce them to this forum throughout the course, or do they need to be in their professional career first?

-JTBorton
Well, You can try banging your head against the wall, but you just end up with lost-time injuries and damaged equipment. [M. Passman]
 
Hi,

I'm a big fan of John Walkenbach, although I do not have his 2007 book.
Also, would it be appropriate to introduce them to this forum throughout the course, or do they need to be in their professional career first?
Yes, as long as you emphasize that Tek-Tips is not a site for homework assignments.

I would also introduce them to sister site,
Skip,
[sub]
[glasses]Just traded in my old subtlety...
for a NUANCE![tongue][/sub]
 
I also have used and enjoyed John Walkenbach's Excel Power Programming.

For a printed reference I can recommend Excel 2007 VBA - Programmer's Reference by Green, Bullen, Bovey and Alexander. It's definitely not a "get you started" text, but it's the most complete printed documentation that I know of. Much like the printed manuals we used to get when we bought software, once upon a time.

My blog also covers engineering applications of Excel regularly (link below).


Doug Jenkins
 
Most of the books I'm finding seem to race through the fundamentals of programming VBA so they can teach the really deep stuff. I'm looking for one that goes more into depth on the fundamentals. Most don't even know what variables are. They can learn the more complicated stuff on their own time in the field.
BRAVO!


I wrote (and teach) a five day course on Word VBA. The first four modules (a whole day) are on fundamentals, and best-practices (for example, using comments, using Ctrl-Spacebar to use IntelliSense faster in the VBE, a full hour on Scope and variables, etc. etc.). I often find people are impatient regarding this. It is not sexy enough.

Gerry
 
DougAJ4 >> Thanks for the reference. I had also considered that book, having the 2003 edition myself, but I just didn't feel it was a good starting book. I was considering recommending it for advanced learning. Thanks for the website reference. I've already started digging into it.

fumei >> Yes, I vaguely remember you building a Word VBA website. Are you still building one, or am I thinking of someone else in this forum? I'd be interested to hear more about this Word VBA course. I'm not as familiar with the Word object library as I'd like to be. I was already thinking it would be great if I had an introductory example to expose students to other forms of VBA.

-JTBorton
Well, You can try banging your head against the wall, but you just end up with lost-time injuries and damaged equipment. [M. Passman]
 
Not a Word VBA website. It is a classroom course that I teach.

Module 1 – Word Object Model
This covers both the general usages of Object Models and the Dot Syntax, and specific usage within. I use a comparison to a car. For example:

Objects have both characteristics (Properties), and perform actions (Methods).
Properties are a characteristic of objects
“EngineBlock” is a property of myCar, as is Colour
Properties are child objects to the parent.
EngineBlock is a child object of myCar.
Syntax – myCar.EngineBlock

Methods describe what an object does, or can do.
“Spark” is an action (method) of SparkPlug
If myCar.EngineBlock.SparkPlug.Voltage < 12 Then
myCar.EngineBlock.SparkPlug.Spark = False
In Word, Open is an action (method) of the Documents
child object of Application.
Application.Documents.Open filename

and on and on.

Module 2 A home for your code
Covers the use of templates as code containers and the
initial building of a global template that will be used
for the course.

There are two hands-on Lab exercises building the following procedures.
ExtractHighlightedParagraphs
Search through document for highlighted paragraphs
If a highlighted paragraph is found, extract it
to a new document
Additional found highlighted paragraphs are added
to the new document

SearchFolderString
Search through all Word .doc files in a folder
for a specific string
If string found add the filename it was found in
to a list
Write the list to a file and save it


Module 3 The Visual Basic Editor
Covers a detailed look at the VBE itself with emphasis
on maximizing efficient use.

Module 4 VBA Concepts and Best Practices
Design Considerations
Naming Conventions
Declaring Variables
Comments
Scope
Functions and Subs
Manipulating Strings – Overview
Informing the user (messageboxes)

The emphasis here is on both the technical aspects, but also very much the use of clear efficient LOGIC...i.e. thinking. For example, for the procedure SearchStringFolder I insist they write out - on paper - the precise logic requirements. No coding. I want them to think...what EXACTLY do I need to do, and EXACTLY what steps are taken when. So they do not know the precise details/syntax of how to use FileSystemObject, Dir, or FileSearch (for versions that have it...ahem).


Gerry
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top