>GRSoftware >VBA Tutor >Newsletter Issues >Newsletter #4 >Newsletter #6
VBA TUTOR NEWSLETTER #5~ 1-3-2000
Help for the beginner to intermediate VBA programmer

This issue of the VBA Tutor Newletter looks at using 'events'. The tutorial in the Excel section demonstrates the importance of using events to help users enter the correct data.

~ VBA in GENERAL ~

To fully implement VBA in either Word, Excel or Access, you must have FULL control over handling 'events'. Events are what 'triggers' a response from the VBA code, such as clicking a button, but just as important, they can be used to guide the user by giving appropriate feedback such as entering data into a form or a spreadsheet. As well as giving some examples of using 'events' below, I have extracted Lesson 33 from the VBA Tutor set of tutorials so it can be viewed from here! It gives a thorough overview along with interactive examples of the various 'events'.

~ VBA in WORD ~

One of the most common uses of VBA is to use the inbuild 'Auto' commands such as ...

AutoExec() ' When you load the Word program.
AutoNew(),WorkbookNewSheet(etc.) ' When you create a new document/sheet.
AutoOpen(),WorkbookOpen(etc.) ' When you open a document/Workbook.
AutoClose(),WorkbookBeforeClose(etc.) ' When you close a document/workbook.
AutoExit ' When you exit the WORD program

For Example:

Sub AutoOpen()
With ActiveWindow
.View.Zoom = 100
.View.Type = wdPageView
.DisplayVerticalRuler = False
.DisplayRulers = False
End With
End Sub

On opening the document, the zoom level is set to '100%', page view is set to 'pageview' and both rulers are set to 'false' (hidden).
Try practising some of these auto commands with different 'properties' and 'values'. Remember that these 'properties' and 'values' can be found by using the procedures outlined in Newsletter No.3 [1-2-2000] and practised in Tutorial No.3.

~ COOL WORD RESOURCE ~
This VBA code cleaner for WORD automatically 'cleans' your code for smaller file size.
[ SKILL LEVEL: All ]

~ VBA in EXCEL ~

EXCEL, more that any other Office program, is where using 'EVENTS' can greatly increase the power of your worksheets. The tutorial for this month creates a public procedure that demonstrate the concept of using 'events' to automatically sort and delete duplicate entries in a column. Go to tut5.htm.

~ COOL EXCEL RESOURCE ~
An excellent MS Office Developer Step by Step guide to creating custom forms in Excel.
[ SKILL LEVEL: Beginner to Intermediate ]

~ VBA in ACCESS ~

Using VBA in ACCESS is not one of our strengths, although we are working on it. So, in this section, we will just point you towards some excellent resources.

~ COOL ACCESS RESOURCE ~
A sample application from the MS Ofice Developer site that uses Internet database connectivity to get Web pages to connect to an ODBC data source and execute SQL statements.
[ SKILL LEVEL: Intermediate to Advanced ]


You're getting smarter...

VBA TIP REQUEST FORM
Contact Name:
Tip Request:
Unsubscribe from this newsletter!

© 2000 Gary Radley