SyntaxWith object [statements] End With
DescriptionThe With...End With block construct is used to execute a series of statements on an object without having to qualify each use with the object name itself. Usage at a Glance
ExamplePublic Structure Point Public x As Integer Public y As Integer End Structure Public Sub TestPoint( ) Dim samplePoint As Point With samplePoint .x = 10 ' Refers to samplePoint.x .y = 100 ' Refers to samplePoint.y End With MsgBox(samplePoint.x) End Sub See AlsoUsing...End Using Statement |