Sub Desordenar() Dim rango As Range Set rango = Selection.Cells For i = 1 To rango.Rows.Count Dim aleatorio As Integer Dim cadena As String rango.Rows(i).Select cadena = ActiveCell.FormulaR1C1 aleatorio = Int(Rnd() * rango.Rows.Count) + 1 rango.Rows(i).FormulaR1C1 = rango.Rows_
(aleatorio).FormulaR1C1 rango.Cells(aleatorio).FormulaR1C1 = cadena Next End Sub
1 comentario:
Excelente, se puede adaptar a casi cualquier rango.
Publicar un comentario