如图,C2公式:
=LARGE(IF(COUNTIF(c$1:c1,ROW($1:$30))=0,ROW($1:$30)),RANDBETWEEN(1,31-ROW(a1)))
数携唯组公式,CTRL+SHIFT+回森隐游此销车,下拉;
用VBA代码(我设置的抽签1-100,不会有重复),如含猜隐下:
Sub cq()
Range("c3:e3").ClearContents
Dim i As Byte
i = 3
T1:
Do While i <6
If Cells(3, i) = "谈厅" Then
Cells(3, i) = Application.RandBetween(1, 100)
End If
i = i + 1
Loop
If Application.Or(Cells(3, 3) = Cells(3, 4), Cells(3, 3) = Cells(3, 5), Cells(3, 4) = Cells(3, 5)) Then
Range("c3:e3").ClearContents
GoTo T1
End If
End Sub
效果如下(若图片没有动画,请兆腔点一下图片)
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)