Hi
See if this gets you started.
Sub aaa()
Dim arr As Variant
strr = "How many to select"
Do
noofcells = Application.InputBox(strr, Type:=1)
If noofcells > Selection.Cells.Count Then strr = "You must select a number less than " & Selection.Cells.Count + 1 & ". How many to select?"
Loop Until noofcells <= Selection.Cells.Count
ReDim arr(noofcells)
tot = 0
Randomize
For i = 0 To noofcells - 1
arr(i) = Evaluate("=randbetween(1," & Selection.Cells.Count & ")")
Next i
If noofcells = 1 Then
Selection.Cells(arr(0)).Select
Else
Set rng = Selection.Cells(arr(0))
For i = 1 To noofcells - 1
Set rng = Union(rng, Selection.Cells(arr(i)))
Next i
rng.Select
End If
End Sub
rylo
Bookmarks