You'll have to swap content manually. This is a very simple function that randomizes a random number of times, swapping rows as it goes. To Grid, you could randomize a column number as well for both From and To.
Fill column A with several numbers leaving no blank rows in that column and Try this:
-------------------------------------------------------------------------
Private Sub CommandButton1_Click()
'There are many different ways you could do this.
'Below is a basic routine for randomizing
Dim vHold As Variant, iFrom As Long, iTo As Long, iRows As Long, iTimes As Long, iCnt As Long
If ActiveSheet.Cells(2, 1).Value = "" Then Exit Sub
With ActiveSheet
iRows = .Range("A1").End(xlDown).Row
iTimes = Int(Rnd(1) * iRows * 1.5) + 5
' Swaps a random number of items anywhere from 5 to 1.5 * rows with data times
For iCnt = 1 To iTimes
iFrom = Int(Rnd(1) * iRows) + 1
iTo = Int(Rnd(1) * iRows) + 1
vHold = .Cells(iFrom, 1).Value
.Cells(iFrom, 1).Value = .Cells(iTo, 1).Value
.Cells(iTo, 1).Value = vHold
Next
End With
End Sub
-------------------------------------------------------------------------
Hope this points you in the right direction.
|