Sub s()
Dim a As Range, b As Range
Set a = Application.InputBox("选择区域", , , , , , , 8)
k = a.Count
If k <= 10 Then Exit Sub
Do
i = Int(Rnd * k + 1)
If b Is Nothing Then
Set b = a(i)
Else
Set b = Union(b, a(i))
End If
Loop Until b.Count = 10
b.Clear
End Sub
使用inputbox()方法 ,如:inputbox("请用鼠标选择区域:“,type:=8),关键在于这个tpye,8代表的是range区域,详细可以见inputbox的帮助