3.1. .
3.2. , 14.
3.3. ' .
4. Visual Basic for Application (VBA).
' , ' . . . .
, () () , 1,06 . 䳿.
4.1. Գ** . .
4.2. ► .
4.3. ' .
4.4. .
4.5. , ( , ), :
'
Forms! []! =Forms! []! *1.06
' .
5. .
5.1. ³ .
5.2. .
5.3. .
5.4. .
5.5. .
5.6. . Գ**.
5.7. .
5.8. , ' . . , . .
5.9. .
6. .
6.1. 2 .
2.
C | |||
3,7 | |||
4,2 | |||
4,0 | |||
3,9 | |||
Գ | 4,1 | ||
4,3 |
6.2. , .
6.3. ³ , .
6.4. .
6.5. Գ**.
|
|
7. '
7.1. ³ **.
7.2. ** ' Գ**.
5.
Ͳ Dz
5.1
: , .
VBA. VBA.
1. VBA , Word, Excel, Access. , Word, Excel, Access, , , . Visual Basic. VBA , , , , , : Project Explorer, Properties Windows .
, . ToolBox Visual Basic. :
(Label) , .
(TextBox) , .
(CommandButton) , - .
2. ³ , . , . ϳ . , ( ). Caption Properties. Name. ( ) , . Delete.
3. ³ , . ³ Properties .
4. ³ . ( ) 䳿, , . , . . 䳿, . , , . , .
|
|
5. ³ , Project . , , View .
6. Run ( Break, Reset) Run.
7. File . File►Remove UserForm. VBA .
Ͳ Dz
5.2
: .
: .
Visual Basic (VB).
1. , 䳿. . VB . , . : If <> Then < 1> Else < 2>
2. , , :
If <> Then
<1>
Else
< 2>
End If
. :
If < 1> Then
<1>
Else If < 2> Then
<2>
...................
Else
< N>
End If
Else.
3. VB
Select Case < >
Case <ij 1>
< 1>
Case <ij 2>
< 2>
.......................................
Case Else
< N>
End Select
- : , , . ij , , . . : 3, x +9. ij: 1 To 5. : Is>25. , , ij .
Ͳ Dz
5.3
: , , .
: .
VBA.
. . : <>< >. 1.
1.
ᒺ | ᒺ | ||||
Label | lbl | ComboBox | cmo | ||
TextBox | txt | Image | img | ||
CommandButton | cmd | Form | frm | ||
CheckBox | chk | TabStrip | tbs | ||
Option Button | opt | MultiPage | mlt | ||
Frame | fra | ToggleButon | tgl | ||
ListBox | lst | ScrollBar | scl |
|
|
, (. 2).
2.
Boolean | bln | |
Byte | byt | |
Integer | ֳ | int |
Long | lng | |
Single | sng | |
Double | dbl | |
Currency | ( ) | cur |
String | str | |
Date | dtm | |
Variant | - | var |
VBA.
3. 4 .
3.
Now | Day() | ||
Date | DateAdd(, , ) | , , | |
Year() | г . | DateDiff(, 1, 2) | ʳ |
Month() | ̳ |
4.
yyyy | г | w | |
g | ww | ||
m | ̳ | h | |
y | n | ||
d | s |
: CBool(x), CByte(x), CCur(x), CDate(x), CDbl(x), CInt(x), CLng(x), CSng(x), CVar(x), CStr(x).
Ͳ Dz
5.4
: .
: , .
.
. , . , . : . For...Next.
:
For = To ʳ [ Step , ]
( )
Next
() . Step , 1. , . 䒺 , . . , ( ), ົ , . : ົ , .
|
|
. . , Do (), Loop ().
:
Do Do
Loop Loop
: While ( -True) Until ( - False), Do Loop, .
.
Do While Do Until Do Do
Loop Loop Loop While Loop Until
Exit Do.
Ͳ Dz
5.5
: .
: .
.
. . , Do (), Loop (). :
Do Do
, ,
Loop Loop
: While ( - True) Until ( - False), Do Loop, .
.
Do While Do Until Do Do
Loop Loop Loop While Loop Until
Ͳ Dz
5.6
: Visual Basic .
: .
.
. . , , , . , (ᒺ, , ). (). ʳ . (), (), .. () . ³ , , A(4) , A(3,4) 12 . Visual Basic . . . ϳ . , ( , ) .., .
, . : Dim A(19) As String. 20 , . , , (General) (Declaration) Option Base 1.
:
(General) (Declaration)
Option Base 1
Dim A(20) As String
: A(1), A(2).........A(20). , , 璺 .
:
(General) (Declaration)
Option Base 1
Dim A(3,4) As String
: A(1,1), A(1,2), A(1,3), A(1,4) - ; A(2,1), A(2,2)........A(2,4) ; A(3,1), A(3,2),.....A(3,4) .
(Public array) Public Declaration. (module level array) Private Declaration . (local array) Private ᒺ.
|
|
Ͳ Dz
5.7
: Visual Basic.
: .
.
. . . ᒺ 䳿, ᒺ Sub. , , Sub Private.
General Declaration Sub , Enter. ϳ . ().
Sub
End Sub
:
Sub My()
End Sub
:
1-: Call My(First Argument, Second Argument)
2-: My First Argument, Second Argument
, Call, . Call , . , .
. ByRef, - ByVal. ByRef, . , .
General (Declaration)
Sub Calk(ByRef First, ByVal Second As Single)
Second = First * 5
End Sub
Private Sub CommandButton1_Click()
Dim B As Single
Dim A As Single
A = 5: B = 10
Call Calk(A, B)
MsgBox (B)
End Sub
10. , 10, , (Second = First * 5) . : Sub Calk(ByRef First, ByRef Second As Single), =25.
.
. , . Function, End Function. ³ , , , , . :
Function NDS (Netto As Currency, Percent As Single) As Currency
NDS = Netto * Percent
End Function
Private Sub CommandButton1_Click()
Dim Tax, SUM As Currency
Tax = NDS(100, 0.15) ' _
SUM = 100 + Tax
MsgBox (SUM)
End Sub
6. 㳿
Ͳ Dz
6.1
: html .
: HTML.
1. . .
1. * *; .
2. .
3. .html *. ϳ : ( . 1 ).
4. , , .
5. .
. 1.
6. *. .html. .html.txt, , 1 .
2. html.
1. .html. Internet Explorer. .
2. Internet Explorer. . , .html .
3. Internet Explorer HTML ( Internet Explorer - ► HTML), . .