arrays - 仅按行随机播放二维数组
问题描述
我正在 Excel 中进行多项选择测验,该测验将显示在 userForm 上。数据在工作表“tempSheet”中,其中包含 D 列中的问题,给定问题的三个选项在 E(“正确的一个”)、F 和 G 列中。我将三个答案加载到二维数组中,以及答案是否正确。
有人可以在表单上使用它之前帮我洗牌这个数组的行吗?我试图阻止正确的答案始终是第一选择。
非常感谢您提前
以下代码只是将信息加载到数组的部分。
子 multChce()
Dim myQstnCell As Range
Dim mChoices(2, 1)
Set myQstnCell = Range("D2")
'Questions are in column D. The correct answer in Column E, then two distractors in F and G
mChoices(0, 0) = myQstnCell.Offset(0, 1).Value
mChoices(0, 1) = "Correct"
mChoices(1, 0) = myQstnCell.Offset(0, 2).Value
mChoices(1, 1) = "Incorrect"
mChoices(2, 0) = myQstnCell.Offset(0, 3).Value
mChoices(2, 1) = "Incorrect"
'answers will be displayed on option buttons
ans_frm.choiceA_Btn.Caption = mChoices(0, 0)
ans_frm.choiceB_Btn.Caption = mChoices(1, 0)
ans_frm.choiceC_Btn.Caption = mChoices(2, 0)
End Sub
解决方案
推荐阅读
- c - 不知道如何实现指向 char 指针数组的指针
- azure - Azure Function BlobContainer.ListBlob 在 Portal CScript 中可用,在 VS C# 中不可用
- image - Android 和 iOS 之间的 Xamarin Forms 图像不匹配
- sql - 在 2 列的条件下从 sql server 中删除重复值
- amazon-web-services - Spark - “spark.deploy.spreadOut = false”可以在 S3 上提供性能优势
- python - 加快熊猫循环计数器
- html - FireFox 中的 SVG 渲染不准确
- macos - 更改输入设备后 AudioKit 导出异步失败
- opencv - 获取已在 OpenCV C++ 中的跟踪算法中跟踪的 ROI 的 x 和 y 像素坐标
- html - Bootstrap 4 - 在css中通过根名称引用颜色