Visual Basic for Applications

15
Visual Basic for Applications Class III

description

Visual Basic for Applications. Class III. User Forms. We place controls on User Forms to get input from the user. Common controls include text boxes, command buttons, and check boxes. Forms and controls can both trigger events that our programs can respond to. Controls. Events. - PowerPoint PPT Presentation

Transcript of Visual Basic for Applications

Page 1: Visual Basic for Applications

Visual Basic for Applications

Class III

Page 2: Visual Basic for Applications

User Forms We place controls on User Forms to get

input from the user. Common controls include text boxes,

command buttons, and check boxes. Forms and controls can both trigger events that our programs can respond to.

Page 3: Visual Basic for Applications

Controls

Page 4: Visual Basic for Applications

Events Any action, e.g. clicking a button, opening

a form, etc. generates an event. VBA handles events by sending them to

procedures named Object_Event. Example: If click on a button named cmdPressMe then VBA will try to run a procedure named cmdPressMe_Click

Page 5: Visual Basic for Applications

Insert: UserForm

Page 6: Visual Basic for Applications

Labels

Page 7: Visual Basic for Applications

Text Boxes

Page 8: Visual Basic for Applications

Combo Box

Page 9: Visual Basic for Applications

Adding Items to Combo Box

Page 10: Visual Basic for Applications

Command Buttons

Page 11: Visual Basic for Applications

Adding Code to Buttons

Page 12: Visual Basic for Applications

RefEdit