. , , : VBA. , . . . , .
. , Microsoft Word, :
.doc.
VBA → → VisualBasic. VBA.
VBA Insert → UserForm.
, , . , Properties. , , . UserForm1. , , Properties. , Properties . Caption, . ٸ , . , , . UserForm1 :
VBA.
.
. -. Properties Backolor, . ٸ , , . , : System () Palette ( ). System, . Palette, ó . - , . Label (), A. - Label1. . Properties Label1 Caption Label1 : VBA.
|
|
. Properties Font - . 18 .
. ForeColor. Properties. ForeColor . , BackColor. Palette ( ). .
CommandButton1 CommandButton2. CommandButton1 Properties Caption : . CommandButton2 , : . Font , 14 . , , ForeColor .
, Label2. . .
Caption : ( , ). Font , 16 , . ForeColor, .
, . , , . Properties Visible False.
. .1.
. 1
. , , . , .
- , . , VBA, .
CommandButton1, , . :
|
|
PrivateSubCommandButton1_Click()
End Sub
. Sub ( Subroutine, - ) . , , , . . CommandButton1, Click (- ). End Sub . .
, ( Label2) . Visible False ( ) True ( ), , , Visible . ( Visual Basic), , .
. , . . , : Label2.Visible. , Visual Basic . , , . , , , :
Label2.Visible = True
, . , , :
Private Sub CommandButton1_Click()
Label2.Visible = True
End Sub
CommandButton1 . . CommandButton1 Label2 .
, . . , . Click ( ). . ٸ , , . DblClick ( ), . :
PrivateSubCommandButton1_DblClick (ByValCancel
As MSForms.ReturnBoolean)
End Sub
, , , , , , . :
Label2.Visible=False
CommandButton1 :
Private Sub CommandButton1_DblClick (ByVal Cancel
As MSForms.ReturnBoolean)
Label2.Visible=False
End Sub
CommandButton1 . , View → Object.
, , CommandButton2. , , :
|
|
Private Sub CommandButton2_Click()
End Sub
, . , CommandButton2. :
End
:
Private Sub CommandButton2_Click()
End
End Sub
, . :
Private Sub CommandButton1_Click()
Label2.Visible = True
End Sub
Private Sub CommandButton1_DblClick(ByVal Cancel As
MSForms.ReturnBoolean)
Label2.Visible = False
End Sub
Private Sub CommandButton2_Click()
End
End Sub
, , . Run → Run . , . 2.
. 2
, , . . , . , . , .
, , - . . , : Compile error ( ). , , . , , , , , . .
, , . Visual Basic , ( File ), .doc .
.
1. VBA?
3. ?
4. ?
5. ?
6. ?
7. , ?
8. ?
9. ?
10. CommandButton?
/
1. VBA ,http://www.lessons-tva.info/edu/e-inf2/m2t3_7.html
2. VBA MSOffice, http://www.libray.narod.ru/rapid/vba_programmirovanie_office.htm
3. VBA
http://www.proklondike.com/books/vb/vb_Cummings_VBA_Dummies.html
13.