Yes, it is very structured. The Army is a very good analogy, as they have a very structured chain of command with very (usually) definite prodecures and policies. We call that Unity of Command/Chain of Command. Very much the same, yes.
Regarding Private and Public type procedures:
Think of them as to who ownership belongs to; who can call it and where it can be called from.
Private:
The routine, function or variable can ONLY be called or run from within that module. Whether it be a worksheet module, standard module, etc.
Public:
A routine, function or variable that can be called from anywhere within the current project. There is no need to redelcare or redefine it. This is helpful if you want to use the same variable in more than one location. Also, probably the best use imho, is to create a UDF (User Defined Function) that can be used *globally* that has many uses.
A great example of this is a function that will tell me if a sheet exists or not ..
And to use such a function in a routine, you can use something like this ...
There are many uses for a function that tests whether a sheet exists or not. You can do this with pretty much anything you wanted, limited only by your imagination.
Some variables that you wish to be *global* would look something like this ...
This can be placed in a Standard Module, generally at the top and outside of any other procedure/sub. Now you can use the variable MYVARIABLE (which means "My String Variable") anywhere in the project.
Now, as for what an Object is, that's a little more in-depth. Let me start by giving you some examples of Objects:
A Worksheet.
A Chart.
A workbook.
An Application.
A Range
A shape (autoshap, square, line, rectangle, freeform, etc.)
Etc, etc.
Objects have properties. You can set these properties from variables, or set these properties to variables. One example is the Name property. Here's an example (all in a standard module) ...
But in essense, Objects have properties and are NOT methods. You will see all of those referred to in the VBE and/or Help files. If you want a much better idea, check out the Object Model in VBA. While in the VBE (Visual Basic Editor: Alt + F11) press F2. This will give you a good idea of properties, methods, objects, etc. The MSDN website has some good information also.
HTH
Bookmarks