End Statement

បញ្ចប់​បែបបទ ឬ​បណ្តុំ​មួយ ។

វាក្យ​សម្ពន្ធ ៖


End, End Enum, End Function, End If, End Property, End Select, End Sub, End With

ប៉ារ៉ាម៉ែត្រ ៖

ប្រើ​សេចក្តី​ថ្លែង​ការណ៍ End ដូច​ខាង​ក្រោម ៖

សេចក្តី​ថ្លែង​ការណ៍

End ៖ មិន​ត្រូវ​​ការ​ ប៉ុន្តែ​អាច​ត្រូវ​បាន​បញ្ចូល​ត្រង់​ណា​ក៏​បាន ក្នុង​បែបបទ​មួយ​ដើម្បី​បញ្ចប់​ដំណើរការ​ប្រតិបត្តិ​កម្មវិធី ។

End Enum: Ends an Enum VBA statement

End Function ៖ បញ្ចប់​សេចក្តី​ថ្លែង​ការណ៍ Function ។

End If ៖ សម្គាល់​ចុង​បញ្ចប់​នៃ បណ្តុំ If...Then...Else ។

End Property: Marks the end of a Property statement.

End Select ៖ សម្គាល់​ចុង​បញ្ចប់​នៃ​បណ្តុំ Select Case ។

End Sub ៖ បញ្ចប់​សេចក្តី​ថ្លែង​ការណ៍ Sub ។

End With: Ends a With statement

ឧទាហរណ៍ ៖


Sub ExampleRandomSelect
Dim iVar As Integer
    iVar = Int((15 * Rnd) -2)
    Select Case iVar
        Case 1 To 5
            Print "Number from 1 to 5"
        Case 6, 7, 8
            Print "Number from 6 to 8"
        Case Is > 8 And iVar < 11
            Print "Greater than 8"
        Case Else
            Print "Outside range 1 to 10"
    End Select
End Sub