InputBox Function

Menampilkan kotak dialog dimana user dapat memasukkan text. Masukkan di berikan pada sebuah variable.

The InputBox statement is a convenient method of entering text through a dialog. Confirm the input by clicking OK or pressing Return. The input is returned as the function return value. If you close the dialog with Cancel, InputBox returns a zero-length string ("").

Sintaksis:

InputBox (Msg As String[, Title As String[, Default As String[, x_pos As Integer, y_pos As Integer]]]])

Nilai hasil:

String

Parameter:

Msg: String expression displayed as the message in the dialog box.

Title: String expression displayed in the title bar of the dialog box.

Default: String expression displayed in the text box as default if no other input is given.

x_pos: Integer expression that specifies the horizontal position of the dialog. The position is an absolute coordinate and does not refer to the window of the office application.

y_pos: Integer expression that specifies the vertical position of the dialog. The position is an absolute coordinate and does not refer to the window of the office application.

If x_pos and y_pos are omitted, the dialog is centered on the screen. The position is specified in twips.

Contoh:

Sub ExampleInputBox

Dim sText As String

    sText = InputBox ("Silakan beri frase:","Apa Kabar Pengguna")

    MsgBox ( sText , 64, "Konfirmasi frase")

End Sub