[mso] Re: Online VB Classes

  • From: "Dian Chapman" <dian@xxxxxxxxxxxxx>
  • To: <mso@xxxxxxxxxxxxx>
  • Date: Tue, 3 Dec 2002 01:07:34 -0600

The basics can be fairly simple, John. Really, I've had folks up and
running in a couple weeks, less if they get my book and move at their
own pace.

You can read user comments here www.mousetrax.com/books.html and here
www.mousetrax.com/techclasses.html.

And I have a lot of free lessons in my forms article at
www.mousetrax.com/techpage.html#autoforms.

Here...give this quickie lesson a try...

* Click Tools/Macro/Macro and type MyMacroTest (all one word), then
click Create.

* You'll move into the VB editor.

* In the location where your cursor will be located...between the Sub
MyMacroTest, some comments about who you are and the End Sub code line,
type the following, EXACTLY as I've typed it, and all on one line.

MsgBox "Hi John, see how easy this can be! Smirk!!"

* Now, while in the editor and with the cursor still in that area of
code, hit the F5 key. Cool, eh?

Now try this one...move your cursor to just after the End Sub from that
code procedure (macro), hit Enter once and start typing this:

Sub MyNextTest()

* Then hit the enter key and the End Sub will be automatically added for
you!

* Now you'll create an Input box to ask a question, pass it in a
Variable and return it in another message box! 

* A variable is like a virtual bucket that holding things kind of in
limbo for you until you need them. They can be just about any name you
want, but there are naming convention rules that you should learn to
follow to keep yourself from going nuts in long code you may write in
the future. But we'll make this simple.

* First, tell the computer what your variable is by typing this:

Dim varMyVariable As String

* Now you'll tell the computer that your variable will be equal to
whatever ends up written in the input box, type the next line of code
like this:

varMyVariable = InputBox("Type your name:")

* So now, when this code runs and someone types their name into the box
and hits the enter key on the box...somewhere in the memory of your
computer, a little piece of memory will be temporarily holding that
name, waiting for you to do something with it. So let's do something
with it!

* type this as the next line:

MsgBox varMyVariable

* that link says, in a message box, display whatever is currently in my
variable. 

Altogether, the final code should look like this:

Sub MyNextTest()

  Dim varMyVariable As String

  varMyVariable = InputBox("Type your name:")

  MsgBox varMyVariable

End Sub

* now hit F5 and see what happens. HA! And you said this stuff was hard!
<smirk>

* Oh, and you can enhance that last message box by changing the code to
this:

MsgBox "Your name is: " & varMyVariable

Dian Chapman
Technical Consultant, Instructor,
Microsoft MVP & TechTrax Editor

Word AutoForm/VBA eBook: http://www.mousetrax.com/books.html
Tutorial web site: http://www.mousetrax.com/techpage.html
TechTrax Ezine: http://www.mousetrax.com/techtrax/

-----Original Message-----
From: mso-bounce@xxxxxxxxxxxxx [mailto:mso-bounce@xxxxxxxxxxxxx] On
Behalf Of John82654@xxxxxxx
Sent: Monday, December 02, 2002 10:47 PM
To: mso@xxxxxxxxxxxxx
Subject: [mso] Re: Online VB Classes


In a message dated 12/2/2002 9:05:49 PM Eastern Standard Time, 
greg@xxxxxxxxxxxxx writes:

> 
> And since there are almost no differences between classic VB (as 
> opposed to VB .Net) and VBA, a VBA course is a great way to begin your

> VB education. More advanced topics like writing standard COM DLLs, 
> transactional threading, etc., are better addressed in standard VB 
> classes. So a beginner's VBA course should be just as valuable and, in

> my opinion, easier to get rolling with.
> 

You read my mind Greg,I was just pondering which one would be better to
start 
with? Also,if there's anything else that might prepare a person for this

totally confusing and scary program. At least to yours truly,LOL


*************************************************************
You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx
or MicrosoftOffice@xxxxxxxxxxxxxxxx

To send mail to the group, simply address it to mso@xxxxxxxxxxxxx

To Unsubscribe from this group, send an email to 
mso-request@xxxxxxxxxxxxx?Subject=unsubscribe

Or, visit the group's homepage and use the dropdown menu.  This will
also allow you to change your email settings to digest or vacation (no
mail). //www.freelists.org/webpage/mso

To be able to use the files section for sharing files with the group,
send a request to mso-moderators@xxxxxxxxxxxxx and you will be sent an
invitation with instructions.  Once you are a member of the files group,
you can go here to upload/download files:
http://www.smartgroups.com/vault/msofiles
*************************************************************

*************************************************************
You are receiving this mail because you subscribed to mso@xxxxxxxxxxxxx or 
MicrosoftOffice@xxxxxxxxxxxxxxxx

To send mail to the group, simply address it to mso@xxxxxxxxxxxxx

To Unsubscribe from this group, send an email to 
mso-request@xxxxxxxxxxxxx?Subject=unsubscribe

Or, visit the group's homepage and use the dropdown menu.  This will also allow 
you to change your email settings to digest or vacation (no mail).
//www.freelists.org/webpage/mso

To be able to use the files section for sharing files with the group, send a 
request to mso-moderators@xxxxxxxxxxxxx and you will be sent an invitation with 
instructions.  Once you are a member of the files group, you can go here to 
upload/download files:
http://www.smartgroups.com/vault/msofiles
*************************************************************

Other related posts: