Sub, ' . , Sub ' , . ' . , . . ³ , . VBA. - , VBA. VBA . , End Sub, VBA, .
:
Ø ;
Ø ;
Ø , .
Ø , .
, ' |, .
Sub ()
̳
()
End Sub
4.
- , , VBA .
VBA : Byte, Integer, Long, Currency.
, . , ' ( ), ' , 300 .
ֳ :
Byte - 0 255
Integer - -32768 32768
Long - -214783648 214783648
, .
Currency - , - 4 .
String. - : , , . VBA
True, False (Boolean). ' ' , .
Variant
, - . VBA Variant , . ', - . , Variant , - .
|
|
- , . . :
' ;
- , ;
, ;
255 ;
䳿 ( ). - .
, , ' .
, , , .
! Single
@ Currency
$ String
% Integer
& Long
|| MsgBox, InputBox.
1 MsgBox :
MsgBox (Prompt [,Buttons] [,Title]
:
Prompt ( ) , . ' , .
Buttons ( ) .
Title ( ) , . , Microsoft Excel.
2 InputBox, , , . ij InputBox Cancel.
InputBox :
InputBox (Prompt [, Title]
:
Prompt () , ' . .
Title .
[ 6,10,20,23 ]
1. || . |?
2. ?
3. .
4. .
5. ' ,
:
) Sub;
) End;
) _1;
) 2;
) 3.
6. ?
7. ?
8. ?
9. ?
10. Dim?
11. ' :
) ;
) 1;
) ;
12. ?
) Dim As Currency;
) Dim As String;
) Temp$
) M!
VBA
1 Excel .
2 VBA Alt+F11. , → .
3 ′ .
( ) | |
Sub () Dim Hello As String Hello="!" Titles$="³ " MsgBox Hello,, Titles$ End Sub | Hello |
|
|
4 , F5. .
³ :
) Hello ?
) Titles ?
) sg ?
5 VBA, :
Sub ()
Dim R@,S@
BoxTitle=" "
R=InputBox(" ", BoxTitle)
S=3.14*R^2
MsgBox,, BoxTitle
End Sub
6 .
7 . S?
Excel :
) || ;
) →|| Microsoft Excel;
) || Alt+Q.
|| VBA. If Then Else. (--)
1 Excel || . VBA ||