Skip to main content This browser is no longer supported. Show
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support. With...End With Statement (Visual Basic)
In this articleExecutes a series of statements that repeatedly refer to a single object or structure so that the statements can use a simplified syntax when accessing members of the object or structure. When using a structure, you can only read the values of members or invoke methods, and you get an error if you try to assign values to members of a structure used in a Syntax
Parts
RemarksBy using For example, to change multiple properties on a single object, place the property assignment statements inside the If your code accesses the same object in multiple statements, you gain the following benefits by using the
The data type of The Within a You can place one You can't branch into a Unless the block contains a loop, the statements run only once. You can nest different kinds of control structures. For more information, see Nested Control Structures. Note You can use the If you're using a Example 1In the following example, each
Example 2The following example nests
See also
FeedbackSubmit and view feedback for What is a group of statements that exists within a program for the purpose of performing a specific task called?A function is a group of statements that exist within a program for the purpose of performing a specific task.
Is a group of statements that together perform a task?Function is a group of statements that performs specific task. It runs only when it is called. You can pass data (parameters) into a function.
What do we call a series of statements that performs a task?A Function procedure is a series of Visual Basic statements enclosed by the Function and End Function statements. The Function procedure performs a task and then returns control to the calling code.
Which of the following is a group of statements which are part of another statement?Compound statements contain (groups of) other statements; they affect or control the execution of those other statements in some way. In general, compound statements span multiple lines, although in simple incarnations a whole compound statement may be contained in one line.
|