tryHi, I want to automatically select an array of random rows and then extract them to a new sheet. For example how do I randomly select row 1,23,76,234 and extract them to a new sheet?
1 . . 23
<tbody>
</tbody>
ect.
Sub test()
Dim b() As Boolean, ash
Dim rws As Long, c As Long, x As Long
Set ash = ActiveSheet
Sheets.Add.Name = "new"
ash.Activate
With Range("A1").CurrentRegion
rws = .Rows.Count: If rws < 4 Then Exit Sub
ReDim b(1 To rws)
Do
x = Int(Rnd * rws) + 1
If Not b(x) Then
c = c + 1
.Rows(x).Copy Sheets("new").Cells(c, 1)
b(x) = True
End If
Loop Until c = 4
End With
End Sub