Sub Essai_Planning1()
Dim Derligne As Long
Dim Cell As Range
Dim alea As Byte 'déclare la variable alea
Derligne = Range("A65536").End(xlUp).Row
For Each Cell In Range("B2:B" & Derligne)
If Cell = "" Then 'condition : si la cellule est vide
Randomize 'initialise le générateur de nombres aléatoires
alea = Int((2 - 1 + 1) * Rnd + 1) 'génère une nombre eleatoire entre 1 et 2
Select Case alea 'agit en fonction de la variabe alea
Case 1 'cas 1
Cell = "Test Matin" 'attribue la valeur "Test Matin" à la cellule
Case 2 'cas 2
Cell = "Test soir" 'attribue la valeur "Test Soir" à la cellule
End Select'fin de l'action en fonction...
End If 'fin de la condition
Next Cell
End Sub