首页 > 系统 > 内容页

excel抽签不重复_excel抽签

2023-07-05 18:14:17 来源:互联网


(资料图片)

1、用VBA代码(我设置的抽签1-100,不会有重复),如下:Sub cq()Range("c3:e3").ClearContentsDim i As Bytei = 3T1:Do While i < 6 If Cells(3, i) = "" Then Cells(3, i) = Application.RandBetween(1, 100) End If i = i + 1LoopIf 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 T1End IfEnd Sub效果如下(若图片没有动画。

2、请点一下图片)。

本文到此分享完毕,希望对大家有所帮助。

关键词:
x 广告
x 广告