MsgBox

  1. F52 8. , ?? .
  2. F52 , ??
  3. II. 2. .
  4. II.1. .
  5. III. Ҳ 1
  6. III. Ҳ ֲ 2
  7. III. Ҳ 3

MsgBox. .

MsgBox , Integer, , .

:

MsgBox(prompt[, buttons] [, title] [, helpfile, context])

MsgBox :

prompt . . (Chr (13)), (Chr (10)) (Chr (13) & Chr (10))
buttons , , , , . 0 ( )
title
helpfile , . , context
context . helpfile

buttons:

vbOKOnly ³ OK
vbOKCancel ³ OK (Cancel)
vbAbortRetryIgnore ³ (Abort), (Retry) (Ignore)
vbYesNoCancel ³ (Yes), ͳ (No) (Cancel)
vbYesNo ³ (Yes) ͳ (No)
vbRetryCancel ³ (Retry) (Cancel).
vbCritical " "
vbQuestion
vbExclamation
vbInformation ""
vbDefaultButton1
vbDefaultButton2
vbDefaultButton3
vbDefaultButton4
vbApplicationModal : ,
VbSystemModal : ,

(0-5) , .

(16, 32, 48, 64) .

(0, 256, 512) , , (0, 4096) - . buttons .

, :

vbOK OK
vbCancel (Cancel)
vbAbort (Abort)
vbRetry (Retry)
vbIgnore (Ignore)
vbYes (Yes)
vbNo ͳ (No)

:

1. : MsgBox " !"

Excel:

2. :

MsgBox " !", _

vbDefaultButton1 + vbInformation, " "

3. :

1) Path = "C: \ St \ .xls"
2) Filename = Dir (Path)
3) If Filename <> "" Then
4) ' :
5) = vbYesNo + vbQuestion + _vbDefaultButton1
6) ' :
7) = MsgBox (( "" & Filename & _ " . ?"), _)
8) Select Case
9) Case vbYes
10) MsgBox " !"
11) Case vbNo
12) MsgBox " ͳ!"
13) End Select
14) Else
15) MsgBox "" & Filename & " !"
16) End If

:

u 5- :

= 4 + 32

' , , .

u 9- 11- ( ):

Case 6

Case 7

- !

u Select Case If-Then-Else. (8) - (13) :

If = vbYes Then

MsgBox " !"

Else

MsgBox " ͳ!"

End If




, . . | 681.3 | | | | ' | | ' | ' Application | ' Worksheet |

© um.co.ua -