1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
|
Sub gerere()
Dim resultat As String
Dim deb As Integer
Dim fin As Integer
Dim plage As Range
deb = 7
fin = 100
Do
resultat = InputBox("Donner le nom", "Gestion")
If resultat <> "" Then 'Si la valeur est différente de "" on affiche le résultat
Range("A" & deb).Value = resultat
Else
Exit Do
End If
heureSaisie = InputBox("Donner le début de l'heure au format xx:xx", "heure")
' Vérifiaction de la validitée
If Len(heureSaisie) Then
Dim tm() As String
tmp = Split(heureSaisie, ":")
End If
' Présence de deux :
If UBound(tmp) = 2 Then
' Lers valeurs sont numériques
If IsNumeric(tmp(0)) And IsNumeric(tmp(1)) Then
erreur = False
End If
End If
heureSaisi = InputBox("Donner la fin de l'heure au format xx:xx", "heure")
' Vérifiaction de la validitée
If Len(heureSaisi) Then
Dim tmr() As String
t = Split(heureSaisi, ":")
End If
' Présence de deux :
If UBound(t) = 2 Then
' Lers valeurs sont numériques
If IsNumeric(t(0)) And IsNumeric(t(1)) Then
erreur = False
End If
End If
If tmp(0) = 5 And tmp(1) = 30 And t(0) = 8 And t(1) = 30 Then '5:30
Set plage = Range("B" & deb, "G" & deb)
plage.Interior.ColorIndex = 50
End If
If tmp(0) = 5 And tmp(1) = 30 And t(0) = 9 And t(1) = 0 Then
Set plage = Range("B" & deb, "H" & deb)
plage.Interior.ColorIndex = 50
End If
If tmp(0) = 5 And tmp(1) = 30 And t(0) = 9 And t(1) = 30 Then
Set plage = Range("B" & deb, "I" & deb)
plage.Interior.ColorIndex = 50
End If
If tmp(0) = 5 And tmp(1) = 30 And t(0) = 10 And t(1) = 0 Then
Set plage = Range("B" & deb, "J" & deb)
plage.Interior.ColorIndex = 50
End If
If tmp(0) = 5 And tmp(1) = 30 And t(0) = 10 And t(1) = 30 Then
Set plage = Range("B" & deb, "K" & deb)
plage.Interior.ColorIndex = 50
End If
If tmp(0) = 5 And tmp(1) = 30 And t(0) = 11 And t(1) = 0 Then
Set plage = Range("B" & deb, "L" & deb)
etc.....
If tmp(0) = 12 And tmp(1) = 30 And t(0) = 20 And t(1) = 30 Then
Range("P" & deb).Interior.ColorIndex = 50
Set plage = Range("Q" & deb, "AE" & deb)
plage.Interior.ColorIndex = 4
End If
If tmp(0) = 12 And tmp(1) = 30 And t(0) = 20 And t(1) = 45 Then
Range("P" & deb).Interior.ColorIndex = 50
Set plage = Range("Q" & deb, "AF" & deb)
plage.Interior.ColorIndex = 4
End If
Call ge 'du coup je veux appeler l'autre bouton "apres midi" qui ressemble à la
meme chose que précédemment mais sa ne fonctionne pas :/
Range("A" & deb) = Range("A" & deb) + Incr
deb = deb + 2
Loop Until deb = fin + 2
End Sub |
Partager