Guest User

Untitled

a guest
Apr 25th, 2012
27
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Dim cislo As Long
  2.  
  3. Private Sub CommandButton1_Click()
  4.     MsgBox operator(cislo)
  5. End Sub
  6.  
  7. Private Sub UserForm_Click()
  8. Dim telefon As String
  9. Dim delka As String
  10.  
  11. telefon = TextBox1.Text
  12.  
  13. If (Len(telefon) = 0) Or (Len(telefon) >= 12) Then
  14.     MsgBox "Musíte vyplnit telefon ve formátu XXX XXX XXX.", vbInformation, "Chyba"
  15. Else
  16.  
  17. If (Mid(telefon, 4, 1) = " ") Or (Mid(telefon, 8, 1) = " ") Then
  18.     MsgBox "Telefon je zadaný ve správném tvaru: " + telefon, vbInformation, "Telefon"
  19.    
  20.     cislo = telefon
  21. Else
  22.     MsgBox "Musíte vyplnit telefon ve formátu XXX XXX XXX.", vbInformation, "Chyba"
  23. End If
  24. End If
  25. End Sub
  26.  
  27. '### FUNKCE OPERATOR ###'
  28.  
  29. Dim cislo As Long
  30.  
  31. Private Sub CommandButton1_Click()
  32.     MsgBox operator(cislo)
  33. End Sub
  34.  
  35. Private Sub UserForm_Click()
  36. Dim telefon As String
  37. Dim delka As String
  38.  
  39. telefon = TextBox1.Text
  40.  
  41. If (Len(telefon) = 0) Or (Len(telefon) >= 12) Then
  42.     MsgBox "Musíte vyplnit telefon ve formátu XXX XXX XXX.", vbInformation, "Chyba"
  43. Else
  44.  
  45. If (Mid(telefon, 4, 1) = " ") Or (Mid(telefon, 8, 1) = " ") Then
  46.     MsgBox "Telefon je zadaný ve správném tvaru: " + telefon, vbInformation, "Telefon"
  47.    
  48.     cislo = telefon
  49. Else
  50.     MsgBox "Musíte vyplnit telefon ve formátu XXX XXX XXX.", vbInformation, "Chyba"
  51. End If
  52. End If
  53. End Sub
Advertisement
Add Comment
Please, Sign In to add comment