Option Explicit
Function CodAlea() As String
Const Carac$ = "ABCDEFGHJKMNPQRSTUVWXYZ123456789abcdefghjkmnpqrstuvwxyz"
Dim chn$, lng As Byte, p As Byte, i As Byte: lng = Len(Carac)
For i = 1 To 20
p = Int(Rnd * lng) + 1: chn = chn & Mid$(Carac, p, 1)
Next i
CodAlea = chn
End Function
Sub Selection_Alea()
Randomize Timer
With Worksheets("Aleatoire").Cells(Int(Rnd * 10) + 1, Int(Rnd * 10) + 1)
If InStr("A1 D4 E5 F8 B8", .Address(0, 0)) = 0 Then .Value = CodAlea()
End With
End Sub