Option Explicit
Sub test()
Dim arr()
Dim Nums
Dim N, L
Dim Ltr As Long, i As Long, j As Long, k As Long
Range("A1:D16").ClearContents
Range("A1:D16").Font.ColorIndex = xlAutomatic
arr = Array("AAEEGN", "ELRTTY", "AOOTTW", "ABBJOO", "EHRTVW", _
"CIMOTU", "DISTTY", "EIOSST", "DELRVY", "ACHOPS", "HIMNQU", _
"EEINSU", "EEGHNW", "AFFKPS", "HLNNRZ", "DEILRX")
Nums = Split(No_Repeat_Random_Numbers(0, 15, 16))
For i = 1 To 4
For j = 1 To 4
Ltr = Int(Rnd() * 6 + 1)
Cells(i, j) = Mid(arr(--Nums(k)), Ltr, 1)
'For debug
Cells(i, j).Offset(6) = arr(--Nums(k))
Cells(i, j).Offset(6).Characters(Start:=Ltr, Length:=1).Font.ColorIndex = 3
Cells(i, j).Offset(12) = Ltr
'end of debug
k = k + 1
Next j
Next i
End Sub
'Dave Hawley - Ozgrid
Function No_Repeat_Random_Numbers(Bottom As Integer, Top As Integer, Amount As Integer)
' No_Repeat_Random_Numbers Macro
' Will generate x unique random numbers between any 2 numbers you specify.
Dim iArr As Variant
Dim i As Integer
Dim r As Integer
Dim temp As Integer
Application.Volatile
ReDim iArr(Bottom To Top)
For i = Bottom To Top
iArr(i) = i
Next i
For i = Top To Bottom + 1 Step -1
r = Int(Rnd() * (i - Bottom + 1)) + Bottom
temp = iArr(r)
iArr(r) = iArr(i)
iArr(i) = temp
Next i
For i = Bottom To Bottom + Amount - 1
No_Repeat_Random_Numbers = No_Repeat_Random_Numbers & " " & iArr(i)
Next i
No_Repeat_Random_Numbers = Trim(No_Repeat_Random_Numbers)
End Function