|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
Public cs As Integer
Sub chuti()
Application.ScreenUpdating = False
Dim ar As Variant, br As Variant
With Sheets("文本")
r = .Cells(Rows.Count, 1).End(xlUp).Row
If r < 2 Then MsgBox "文本工作表为空!": End
ar = .Range("a1:hc" & r)
End With
With Sheets("演示")
fs = .[d1]
ks = .[d2]
js = .[d3]
If fs = "" Then MsgBox "请选择出题方式!": End
If fs = "顺序" Then
If ks = "" Then MsgBox "请输入开始序号!": End
If js = "" Then MsgBox "请输入结束序号!": End
If ks > js Then MsgBox "开始需要必须小于等于结束序号": End
If cs = 0 Then
cs = ks
Else
cs = cs + 1
End If
If cs > js Then Exit Sub
.[a3] = cs
.[b3] = ar(cs, 2)
.[c3] = ar(cs, 3)
Else
sjs = Application.RandBetween(2, r)
.[a3] = sjs
.[b3] = ar(sjs, 2)
.[c3] = ar(sjs, 3)
End If
End With
End Sub
|
评分
-
1
查看全部评分
-
|