Computer Science, asked by harshil2007, 8 months ago

where is Visual Basics in Excel write answers would be marked as brainliest and wrong answers would be reported ​

Answers

Answered by ajha29884
1

Answer:

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

In the MsgBox function syntax, the italic words are named arguments of the function. Arguments enclosed in brackets are optional. (Do not type the brackets in your Visual Basic code.) For the MsgBox function, the only argument you must provide is the text for the prompt.

Arguments for functions and methods can be specified in code either by position or by name. To specify arguments by position, follow the order presented in the syntax, separating each argument with a comma, for example:

VB

Copy

MsgBox "Your answer is correct!",0,"Answer Box"

To specify an argument by name, use the argument name followed by a colon and an equal sign (:=), and the argument's value. You can specify named arguments in any order, for example:

VB

Copy

MsgBox Title:="Answer Box", Prompt:="Your answer is correct!"

The syntax for functions and some methods shows the arguments enclosed in parentheses. These functions and methods return values, so you must enclose the arguments in parentheses to assign the value to a variable. If you ignore the return value or if you don't pass arguments at all, don't include the parentheses. Methods that don't return values do not need their arguments enclosed in parentheses. These guidelines apply whether you are using positional arguments or named arguments.

In the following example, the return value from the MsgBox function is a number indicating the selected button that is stored in the variable myVar. Because the return value is used, parentheses are required. Another message box then displays the value of the variable.

VB

Copy

Sub Question()

myVar = MsgBox(Prompt:="I enjoy my job.", _

Title:="Answer Box", Buttons:="4")

MsgBox myVar

End Sub

Option Compare statement syntax

Option Compare { Binary | Text | Database }

In the Option Compare statement syntax, the braces and vertical bar indicate a mandatory choice between three items. (Do not type the braces in the Visual Basic statement). For example, the following statement specifies that within the module, strings will be compared in a sort order that is not case-sensitive.

VB

Copy

Option Compare Text

Dim statement syntax

Dim varname [([ subscripts ])] [ As type, ] [ varname [([ subscripts ])] [ As type ]] . . .

In the Dim statement syntax, the word Dim is a required keyword. The only required element is varname (the variable name).

For example, the following statement creates three variables: myVar, nextVar, and thirdVar. These are automatically

Similar questions