Austin,
Disregard my original code. I cobbled it together in haste and allowed for only 2 criteria circumspection checks instead of four. The following fixes the problem.
Sub AdjacentUniqueRandNos()
MsgBox "No 2 adjacent cells are equal" & vbCrLf & "but duplicates may exist in the Range"
With Application
.Calculation = xlCalculationManual
.ScreenUpdating = False
End With
Range("A1:L12").Clear
Rows(1).Insert
Columns("a").Insert
For i = 2 To 12
For j = 2 To 12
Do Until Cells(i, j) <> Cells(i, j).Offset(0, 1) And Cells(i, j) <> Cells(i, j).Offset(1, 0) And Cells(i, j) <> Cells(i, j).Offset(-1, 0) And Cells(i, j) <> Cells(i, j).Offset(0, -1)
Randomize
Cells(i, j) = Int(10 + Rnd * 90)
Loop
Next
Next
Rows(1).Delete
Columns("a").Delete
With Application
.Calculation = xlCalculationAutomatic
.ScreenUpdating = True
End With
End Sub
[By the way, if you want 2 digit numbers in every cell, the Worksheet formula =RAND*99 may yield single digit numbers 0 to 9 as wells as 10 to 98. Note that, 99 will be excluded as the RAND() function has the range 0 to less than 1 . The correct WorkSheet formula should be Int(10+Rand()*90) and in VBA Int(10+Rnd*90) or if you have AnalysisToolPack installed =RANDBETWEEN(10 ,99).
Bookmarks