.


:




:

































 

 

 

 





, , Value:

Private Sub cmdOK_Click()

Dim As String

= cbo.Value

MsgBox " " & & "!", _

vbInformation, ""

Unload Me

End Sub

:

frm .

, , [11] (. 10‑11):

. 10‑11.

:

1. ( !) , , C:\St\.xls (. 10‑10).

2. . , - .

1) :

cmdOK

cmd

cbo

lst

2) frm.

:

1. , 10 :

Sub ()

' 1. :

Dim () As String

Dim As String

Dim As Integer

Dim As Integer

Dim As Integer

'2. C:\St\.xls

Call ("C:\St\.xls")

If flag = 0 Then Exit Sub

'3.

Call ("")

If flag = 0 Then Exit Sub

'4. :

= 3

Do While Trim(Cells(, 1).Value) <> ""

= + 1

Loop

= 1 '-

ReDim Preserve () As String

() = Trim(Cells(3, 1).Value)

For i = 3 To - 1

If Trim(Cells(i + 1, 1).Value) <> "" Then

= Trim(Cells(i + 1, 1).Value)

For j = 1 To

If = (j) Then GoTo n3

Next j

= + 1

ReDim Preserve () As String

() = Trim(Cells(i + 1, 1).Value)

End If

n3: Next i

'5. :

Call ()

'6. :

frm.cbo.List =

frm.Show

End Sub

2. ( !) cbo - Private Sub cbo_Change. :

Option Base 1

Private Sub cbo_Change()

Dim () As String

Dim () As String

'1. :

= 3

= 0

Worksheets("").Select

While Trim(Cells(, 2).Value) <> ""

If Trim(Cells(, 1).Value) = _

cbo.Value Then

= + 1

ReDim Preserve (2, )

(1, ) = _

Cells(, 2).Value

(2, ) = _

Cells(, 3).Value

End If

= + 1

Wend

'2. :

ReDim ( + 1, 2)

For i = 1 To

(i, 1) = (1, i)

(i, 2) = (2, i)

Next i

'3. , :

With lstC

.ColumnCount = 2

.MultiSelect = fmMultiSelectMulti

.List =

End With

End Sub

3. : , :

Private Sub cmdOK_Click()

Dim As Integer

Dim As String

For i = 0 To lstC.ListCount - 1

If lstC.Selected(i) = True Then

= + 1

End If

Next i

MsgBox " " & & _

" " & & "!", _

vbInformation, ""

Unload Me

End Sub

4. :

Private Sub cmd_Click()

Unload Me

End Sub

5. .

6. : frm.cbo.List = , . Private Sub cbo_Change().

(CheckBox)

, . CheckBox, ToggleButton OptionButton.

, , :

. 10‑12.

: ( !) .

1) :

cmdOK

cmd

chk

chk

2) frmCheckBox.

, , :

Sub frmCheckBox_Initialize()

cmdOK.Default = True

cmd.Cancel = True

chk.Caption = " "

chk.Caption = " "

chk.Value = True

End Sub

:

1. 11 frmCheckBox_Initialize.

2. frmCheckBox / cmd, .

, () .

, , Value:

Private Sub cmdOK_Click()

If Chk.Value = True And chk.Value = True Then

MsgBox " !", vbInformation, _

""

ElseIf Chk.Value = True And chk.Value = False Then

MsgBox " !", vbInformation, _

""

ElseIf Chk.Value = False And chk.Value = True Then

MsgBox " !", vbInformation, _

""

Else

MsgBox " !", vbInformation, _

""

End If

Unload Me

End Sub

:

.





:


: 2016-03-28; !; : 301 |


:

:

, - , ; , - .
==> ...

1582 - | 1586 -


© 2015-2024 lektsii.org - -

: 0.017 .