Advertisement
Guest User

Untitled

a guest
Oct 28th, 2016
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.83 KB | None | 0 0
  1. Sub MacroSelection()
  2. Range("A1:B6").Select
  3. Selection.Font.Bold = True
  4. Selection.Value = "Bonjour"
  5. Range("B6").Select
  6. Selection.Value = "Bonsoir"
  7. End Sub
  8.  
  9. Sub MacroSecondDegré()
  10. Dim delta, resultat, resultat1, resultat2
  11.  
  12. delta = Range("C2").Value * Range("C2").Value - 4 * Range("A2").Value * Range("E2")
  13.  
  14. Range("G3").Value = delta
  15.  
  16. If (delta = 0) Then
  17. resultat = -(Range("C2").Value / (2 * Range("A2").Value))
  18. MsgBox resultat
  19.  
  20. End If
  21.  
  22. If (delta > 0) Then
  23. resultat1 = (-Range("C2").Value + Sqr(delta)) / (2 * Range("A2").Value)
  24. resultat2 = (-Range("C2").Value - Sqr(delta)) / (2 * Range("A2").Value)
  25. Range("H3").Value = resultat1
  26. Range("I3").Value = resultat2
  27. End If
  28. End Sub
  29.  
  30. Sub parite()
  31. If (Range("A10").Value Mod 2 = 0) Then
  32. resultat = "Pair"
  33. Else
  34. resultat = "Impair"
  35. End If
  36. MsgBox resultat
  37. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement