Mira, leelo y entendelo, no te lo tendria que dejar pero bueno:
Código (vb) [Seleccionar]
Option Explicit
Public Sub Form_Load()
Dim n As Integer
Dim a(9) As Integer
Dim m As Integer
Dim i As Integer
For i = 0 To 9
Do
Randomize
m = Int((Rnd * 10) + 1)
Loop While (Existe(m, a()))
a(i) = m
Next i
For i = 0 To 9
MsgBox a(i)
Next
End Sub
Function Existe(m As Integer, a() As Integer) As Boolean
Dim num
For Each num In a()
If (m = num) Then Existe = True
Next
End Function