.


:




:

































 

 

 

 


VBA




Visual Basic , , , . .

. Visual Basic , , , . , Function, . , , , ( 0). , , , . , Visual Basic, :

If...Then, If...Then...Else, Select Case

If... Then. If...Then . , :

If Then

If Then

End If

, , . Visual Basic True False; False, , , True. True, Visual Basic , Then. . :

If anyDate < Now Then anyDate = Now

If anyDate < Now Then

anyDate = Now

End If

, If...Then End If. , True, If...Then...End If.

If anyDate < Now Then

anyDate = Now

Timer1.Enabled = False '

End If

If... Then, , False, True. , , , . :

If Total Then

Summa = Summa + Total

End If

, , (Total <> 0) . , ,

If... Then... Else. If... Then Visual Basic. : (False) If... Then , . , , True, , False. If... Then... Else. , :

If 1 Then

[_ 1]

[ElseIf 2 Then

[_, 2]]...

[Else

[_ ]]

End If

Visual Basic 1. False, Visual Basic 2, . ., True. True, Visual Basic _ , End If. Else, Visual Basic , True.

If...Then... ElseIf lf...Then...Else; Elself . Else , Elself.

, Elself , Select Case.

Select Case. lf...Then...Else, Visual Basic Select Case . Select Case , lf...Then...Else, . Select Case , , . Visual Basic Case . , , Case:

Select Case _

[Case _1 ]

[ _ 1 ]

[Case _2 ]

[ _ 2 ]

...

[ Case Else]

[ _ n]]

End Select

_ . , . _ . _ Case, , Case. _ , _, Visual Basic Case Else ( ).

, Select Case . , lf...Then...Else Elself .

Select Case lf...Then...Else , If Elself .

-. , -, Visual Basic, . Visual Basic : DoLoop, ForNext, For EachLoop.

DoLoop. . Do...Loop, , , . If...Then, , False () True ( ).

Do...Loop , True:

Do While

Loop

Visual Basic Do, . False (), . True, Visual Basic Do While .

, , True. , False.

Do...Loop , . , , :

Do

Loop While

, , , False True ( ).

:

Do Until

Loop

, , :

Do

Loop Until

ForNext. . , ( Do) , . For , , . For... Next :

For = [Step ]

[ ]

Next []

, , .

, . , , . , . Step , , , 1. , .

For Visual Basic:

1. .

2. . . Visual Basic ( , Next). , . Visual Basic , .

3. .

4. 1 , .

5. 2- 4-, .

For EachNext. For...Next For Each...Next, .

For Each...Next For...Next, , , , . , , .

For Each...Next :

For Each In

Next

For Each...Next :

Variant, Object (), ;

Variant;

For Each...Next , Variant .





:


: 2018-10-14; !; : 342 |


:

:

, , .
==> ...

1837 - | 1487 -


© 2015-2024 lektsii.org - -

: 0.026 .