Kod:
Private Sub Komut0_Click()
On Error GoTo HataKontrol
If Metin1 / Metin3 <> Metin1 \ Metin3 Then
MsgBox "geçersiz sonuç"
Else
Metin6 = Metin1 / Metin3
End If
Exit Sub 'burada programa son verilir.
HataKontrol:
Select Case Err.Number
Case 11: Mesaj = "Sıfıra bölünme hatası oluştu!!!"
End Select
MsgBox Mesaj
Resume Next
End Sub