.


:




:

































 

 

 

 


1

VBA

:

VBA .

 

:

: , , , ; .

 

VBA

Microsoft Visual Basic for Applications (VBA). .

VBA Visual Basic. , MS Excel | | Visual Basic <Alt> + <F11>. (IDE).

1. (IDE).

Visual Basic , Excel.

, VBA, . : , , .

Windows : , . 1 : Project VBA Project Properties.

Project VBAProject View | Project Explorer (1) Project Explorer (2) . Project VBAProject . , .

Project VBAProject .

. , .

Properties View | Properties Window (1) Properties (2) .

:

  1. Project VBAProject .
  2. Project VBAProject .
  3. .
  4. Properties .
  5. Properties .

. . : . , . Alphabetic Categorized, . Name ( ) . . . , Label1, Label2, Label3 . Name . .

:

  • ;

.

:

  1. , Properties.
  2. : Form1. Caption Form1 1. Caption .

, , . , , .

, . Insert | UserForm. ToolBox.

Windows- . Windows , , , . , , F5 . F5 : , , .

:

1. .

2. , F5. , .

3. .

 

2. , .

ToolBox .

  • (Label) , .
  • (TextBox) .
  • (CommandButton).
  • (ListBox, ComboBox).
  • .

:

  • , .
  • , .
  • , , .
  • .

, Delete.

:

1. .

2. .

 

, .

(.3):

1. Label1. Label1 , , . Caption , . . Caption .

2. (Label2). Caption .

3. TextBox1, Label3, Caption. TextBox . , , .

4. CommandButton. . Windows . Caption .

5. , Font . ForeColor.

6. (F5).

3. .

. , , .

:

, . . . View | Code F7.

1. F7.

  1. . , . , . , ( ). Click ( ) .

Private Sub CommandButton1_Click()

 

End Sub

, .

3. (), , . Sub End VBA:

x = Val(TextBox1.Text)

y = x / 400

Label3.Caption = Str(y) + " ."

, . Text TextBox1 , . Text , ( Val). . Caption. Str . . .

4. , F5. , , Label3.

 

 

/
1 : 1 . . . = 133
2 : 1 = 2.54
3 : 1 = 36.37 3
4 : 1 = 4.19
5 : 1 = 0.9144
6 : 1 *2 = 9.81
7 : 1 = 1.76
8 : 1 = 0.5683 3
9 : 1 * = 9.81
10 : 1 = 500
11 : 1 /2 = 0.1
12 : 1 = 4.54 3
13 : 1 = 10-7
14 : 1 * = 3.6*103

 

, , .

1.

 

1. Project VBAProject?

2. Project VBAProject?

3. Properties?

4. Properties?

5. ?

6. ?

7. ?

8. ?

9. ?

10. ToolBox?

11. : Label, TextBox, CommandButton?

12. Name, ?

13. ?

14. ?

15. Text, ?

16. ?

 



<== | ==>
| ()
:


: 2016-09-06; !; : 423 |


:

:

, .
==> ...

1793 - | 1562 -


© 2015-2024 lektsii.org - -

: 0.024 .