Dear Forum,
I am using the VBA code below (bottom) to return random numbers for a selected area of cells where the range of random numbers is between 1 and the
total number of cells. Unfortunately sometimes the random numbers appear more than once and I would like to amend this to ensure duplicates are not included, any help would be greatly appreciated, thanks, Matt
Ps I have already tried substituting with VBUniqRandInt() but it returns #NAME? in every selected cell??, i.e;
Sub RandomTable4()
For Each r In Selection
r.Formula = "=int(VBUniqRandInt() *" & Selection.Count & "+1)"
Next
End Sub
Sub RandomTable4() ' but this returns duplicates
For Each r In Selection
r.Formula = "=int(Rand() *" & Selection.Count & "+1)"
Next
End Sub
Bookmarks