Finance

Charts

Statistics

Macros

Search

Event-Handling Procedure with Excel VBA

Besides regular procedures, VBA has procedures that handle events associated with a particular object. In general, such procedures are written as:

[Private] Sub ObjectName_EventName(ParameterList)
    Instructions
End Sub

The keyword Private is an access modifier that indicates the procedure is visible to other procedures only within the module in which it resides.

For example, a procedure that handles the activation of a worksheet looks like this:

Private Sub Worksheet_Activate()
    Instructions
End Sub

 

0 0 votes
Évaluation de l'article
S’abonner
Notification pour
guest
0 Commentaires
Le plus ancien
Le plus récent Le plus populaire
Online comments
Show all comments
Facebook
Twitter
LinkedIn
WhatsApp
Email
Print
0
We’d love to hear your thoughts — please leave a commentx