I need 5 groups of 16 cells with the numbers 1 through 16 inserted in each group.
Sub Groups5()
Dim dict As Object, i As Long, x As Long, y As Long, j As Long
Set dict = CreateObject("scripting.dictionary")
For i = 1 To 16
dict(i) = i
Next
For j = 1 To 5
For i = 1 To 16
x = WorksheetFunction.RandBetween(1, 16)
y = dict(x)
dict(x) = dict(i)
dict(i) = y
Next
i = 1
For Each c In Cells(2, ((j - 1) * 5) + 1).Resize(4, 4)
c.Value = dict(i)
i = i + 1
Next
Next
End Sub