
Dim c As Range
Dim i As Integer
Dim j As Integer
Dim kk As Integer
Dim Swap As String
Dim NRighe As Integer
Dim NColonne As Integer
Set c = Selection
NColonne = c.Columns(c.Columns.Count).Column - c.Column + 1
NRighe = c.Rows(c.Rows.Count).Row - c.Row + 1
If NColonne = 1 Then
Randomize
For kk = 1 To NRighe * 5
i = Int((NRighe * Rnd) + 1)
j = Int((NRighe * Rnd) + 1)
Swap = c.Cells(i, 1).Value
c.Cells(i, 1).Value = c.Cells(j, 1).Value
c.Cells(j, 1).Value = Swap
Next
End If |
