我也用vba做选择题(开源)

chenshengfa 发表于: 2010-3-20 22:17 来源: 扑奔PPT网

看见很多人都做,我也做一个玩玩,代码可见,大家多多支持

我也用vba做选择题(开源) (139 KB, 下载次数: 678)

大家对 我也用vba做选择题(开源) 的评论
jack0421 发表于 2010-3-21 22:16:13
Private Sub CommandButton1_Click()
    Slide10.OptionButton1.Value = False
    Slide10.OptionButton2.Value = False
    Slide10.OptionButton3.Value = False
    Slide10.OptionButton4.Value = False
End Sub
Private Sub CommandButton2_Click()
    Dim s As Integer
    s = 0
    If Slide1.OptionButton1.Value = True Then
        s = s + 10
    Else
        s = 0
    End If
    If Slide2.OptionButton3.Value = True Then
        s = s + 10
    Else
        s = s
    End If

    If Slide3.OptionButton4.Value = True  Then
        s = s + 10
    Else
        s = s
    End If

    If Slide4.OptionButton3.Value = True Then
        s = s + 10
    Else
        s = s
    End If
    If Slide5.OptionButton3.Value = True Then
        s = s + 10
    Else
        s = s
    End If

    If Slide6.OptionButton2.Value = True Then
        s = s + 10
    Else
        s = s
    End If
    If Slide7.OptionButton1.Value = True Then
        s = s + 10
    Else
        s = s
    End If

    If Slide8.OptionButton4.Value = True Then
        s = s + 10
    Else
        s = s
    End If
    If Slide9.OptionButton3.Value = True Then
        s = s + 10
    Else
        s = s
    End If
    If Slide10.OptionButton2.Value = TrueThen
        s = s + 10
    Else
        s = s
    End If

    If s = 100 Then
        MsgBox s, , "天才,满分"
        MsgBox "恭喜你,按确定查看密码吧"
        SlideShowWindows(Index:=1).View.GotoSlide Index:=11
    End If
    If s >= 90 And s < 100 Then
        MsgBox s, , "非常棒,总分为"
        MsgBox "恭喜你,按确定查看密码吧"
        SlideShowWindows(Index:=1).View.GotoSlide Index:=11
    End If
    If s >= 80 And s < 90 Then
        MsgBox s, , "不错,总分为"
        MsgBox "恭喜你,按确定查看密码吧"
        SlideShowWindows(Index:=1).View.GotoSlide Index:=11
    End If
    If s >= 70 And s < 80 Then
        MsgBox s, , "一般般啦,总分为"
        MsgBox "继续加油哦"
    End If
    If s >= 60 And s < 70 Then
        MsgBox s, , "刚刚及格,总分为"
        MsgBox "继续加油哦"
    End If
    If s < 60 Then
        MsgBox s, , "挂了,总分为"
        MsgBox "继续加油哦"
    End If
End Sub
Private Sub CommandButton3_Click()
    SlideShowWindows(Index:=1).View.GotoSlide Index:=1
End Sub
Private Sub CommandButton4_Click()
    With SlideShowWindows(1).View
        .GotoSlide 9
    End With
End Sub

 



[ 本帖最后由 jack0421 于 2010-3-22 21:34 编辑 ]

幻灯片2.JPG
幻灯片2.JPG

幻灯片3.JPG
幻灯片3.JPG

幻灯片4.JPG
幻灯片4.JPG

幻灯片5.JPG
幻灯片5.JPG

幻灯片6.JPG
幻灯片6.JPG

幻灯片7.JPG
幻灯片7.JPG

幻灯片8.JPG
幻灯片8.JPG

幻灯片9.JPG
幻灯片9.JPG

幻灯片10.JPG
幻灯片10.JPG

幻灯片11.JPG
幻灯片11.JPG

chenshengfa 发表于 2010-3-22 00:22:31
谢谢帮忙了
jack0421 发表于 2010-3-22 21:29:56
不好意思,看成多选了,单选的代码就简单多了!
只修改了一部分中间的,别的没动.

[ 本帖最后由 jack0421 于 2010-3-22 21:35 编辑 ]
kzzx688 发表于 2010-4-12 23:53:03
谢谢分享!!!!!!!!
flywin 发表于 2010-4-13 17:58:42
学习经验,如果不用VBA实现就好啦。
yanggxia 发表于 2010-4-13 19:58:47
不是很懂 怎么才能实现啊?
banduwuyan 发表于 2010-4-14 10:44:36
工作量太大,代码重用率太低,建议把VBA弄个差不多才发布这个帖子
sjzngcb 发表于 2010-4-21 09:13:41
谢谢分享!!!!!!!!
chenshengfa 发表于 2010-4-25 00:34:27
本人不太擅长vba,见笑了
nls7971727 发表于 2010-6-26 16:59:40
不懂,但见识了。
我会幸福 发表于 2010-7-11 15:57:10
真是高手。
笨蛋JXC 发表于 2011-3-05 17:00:14
-0-我学识浅。看得不是很懂!嘿嘿~
好多要学习的地方呢
qfsfxx 发表于 2012-3-10 10:09:26
谢谢分享,VBA想学好不容易啊,看一会就烦。
axwdmp3 发表于 2012-3-13 16:21:51
应该讲一讲,或有注释就更好了!!!
最新PPT模板
最新贴子
PPT热贴