Excel精英培训网

 找回密码
 注册
数据透视表40+个常用小技巧,让你一次学会!
查看: 9928|回复: 33

[通知] 统计VBA学习小组正式组的积分帖之作业上交贴(第20周)

  [复制链接]
发表于 2012-5-30 10:34 | 显示全部楼层 |阅读模式
活动类型:
作业上交
开始时间:
2012-5-30 02:42 至 2012-6-5 02:42 商定
活动地点:
VBA学习小组
性别:
不限
已报名人数:
27

本帖最后由 冠军欧洲2010 于 2012-6-6 08:39 编辑

说明:
统计帖每个学员只能跟帖回复一次,也就是在原来回复楼层的基础上点编缉,不要一个链接一层楼,否则不计算积分。

各小组学员上交作业时,一定要点击我要参加注明自己的新组编号和论坛ID如果点击过我要参加但没有跟帖提交作业的,扣该学员5积分;如果跟帖提交了作业,但没有点我要参加的,不给予评分。

请各学员看清上面的说明,免得被扣了分分!
本帖为仅楼主可见帖,直接回复即可!
作业链接:

http://www.excelpx.com/thread-245811-1-1.html

已通过 (10 人)

  留言 申请时间
ls

h22:ls

2012-6-1 01:17
我不知道呀

8组我不知道呀

2012-5-31 22:09
qushui 2012-5-31 17:40
jxncfxsf

D24组:jxncfxsf

2012-5-31 17:38
LIYEHUAOK

liyehuaok

2012-5-31 16:29
hrpotter

C12:hrpotter

2012-5-31 15:46
hactnet

H组-h15-hactnet

2012-5-31 15:12
jlf2003

A22:JLF2003

2012-5-31 15:04

暂未通过 (17 人)

  留言 申请时间
w2001pf 2012-6-5 10:33
mfksypss 2012-6-5 08:14
zjyxp 2012-6-4 23:24
byhdch 2012-6-3 21:19
开心rabbit 2012-6-3 17:37
gaoshuichang1 2012-6-3 17:01
yijundanny 2012-6-3 16:08
yl_li 2012-6-3 15:42
excel精英培训的微信平台,每天都会发送excel学习教程和资料。扫一扫明天就可以收到新教程
发表于 2012-5-30 14:29 | 显示全部楼层
回复

使用道具 举报

发表于 2012-5-31 09:28 | 显示全部楼层
Private Sub UserForm_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
    If KeyCode = 27 Then Unload Me
    If KeyCode = 90 And Shift = 2 Then Me.Height = Me.Height + 10
    If KeyCode = 88 And Shift = 2 Then Me.Height = Me.Height - 10
End Sub

Private Sub UserForm_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
    If Button = 1 And Shift = 3 Then Unload Me
End Sub

评分

参与人数 1金币 +10 收起 理由
兰色幻想 + 10 答案正确

查看全部评分

回复

使用道具 举报

发表于 2012-5-31 15:11 | 显示全部楼层
来交下窗体与控件2作业!H组-h15-hactnet
Private Sub UserForm_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
   
If KeyCode = 27 Then
    Unload Me
ElseIf KeyCode = 90 And Shift = 2 Then      'z=90,x=88
    Me.Height = Me.Height + 10
ElseIf KeyCode = 88 And Shift = 2 Then
    Me.Height = Me.Height - 10
End If
   
End Sub

Private Sub UserForm_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)

If Button = 1 And Shift = 3 Then
    Unload Me
End If

End Sub

VBA基础入门窗件与控件2作业-H组-h15-hactnet.rar

10.21 KB, 下载次数: 11

评分

参与人数 1金币 +10 收起 理由
兰色幻想 + 10 答案正确

查看全部评分

回复

使用道具 举报

发表于 2012-5-31 15:12 | 显示全部楼层
呵呵,我终于做好了,请老师审批。谢谢!
代码如下:
一、分项回答:
Option Explicit
'1、按ESC键可以关闭窗体
Private Sub UserForm_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer) '按下键时
If KeyCode = 27 Then
  Unload Me
End If
End Sub
'2、按CTRL+Z 窗体的高度在原来的高度上+10(窗体的高度越来越高)
Private Sub UserForm_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer) '按下键时
If KeyCode = 90 And Shift = 2 Then
  UserForm1.Height = UserForm1.Height + 10
End If
End Sub
'3、按CTRL+X 窗体的高度在原来的基础上-10
Private Sub UserForm_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer) '按下键时
If KeyCode = 88 And Shift = 2 Then
  UserForm1.Height = UserForm1.Height - 10
End If
End Sub
'4、按ctrl+shift键的同时左键单击窗体,可以把窗体关闭
Private Sub UserForm_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single) '鼠标左键按下
   If Button = 1 And Shift = 3 Then
   Unload Me
   End If
End Sub

'二、1-4问题总回答实际运行
'1-3问题答案
Private Sub UserForm_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer) '按下键时
If KeyCode = 27 Then
  Unload Me
End If
If KeyCode = 88 And Shift = 2 Then
  UserForm1.Height = UserForm1.Height - 10
End If
If KeyCode = 90 And Shift = 2 Then
  UserForm1.Height = UserForm1.Height + 10
End If
End Sub
'4问题答案
Private Sub UserForm_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single) '鼠标左键按下
   If Button = 1 And Shift = 3 Then
   Unload Me
   End If

End Sub

第17讲作业JLF2003.zip (8.81 KB, 下载次数: 2)

评分

参与人数 1金币 +10 收起 理由
兰色幻想 + 10 答案正确

查看全部评分

回复

使用道具 举报

发表于 2012-5-31 15:46 | 显示全部楼层
C12:hrpotter
  1. Private Sub UserForm_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
  2.     If KeyCode = 27 Then
  3.         Unload Me
  4.     ElseIf KeyCode = 88 And Shift = 2 Then
  5.         Me.Height = Me.Height - 10
  6.     ElseIf KeyCode = 90 And Shift = 2 Then
  7.         Me.Height = Me.Height + 10
  8.     End If
  9. End Sub
  10. Private Sub UserForm_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
  11.     If Button = 1 And Shift = 3 Then
  12.         Unload Me
  13.     End If
  14. End Sub
复制代码

评分

参与人数 1金币 +10 收起 理由
兰色幻想 + 10 答案正确

查看全部评分

回复

使用道具 举报

发表于 2012-5-31 16:30 | 显示全部楼层
Private Sub UserForm_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
    Select Case KeyCode
        Case 27
            Unload Me
       End Select
    If KeyCode = 90 And Shift = 2 Then
         Me.Height = Me.Height + 10
    ElseIf KeyCode = 88 And Shift = 2 Then
        Me.Height = Me.Height - 10
    End If
End Sub

Private Sub UserForm_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
    If Button = 1 And Shift = 3 Then
        Unload Me
    End If
End Sub

评分

参与人数 1金币 +10 收起 理由
兰色幻想 + 10 答案正确

查看全部评分

回复

使用道具 举报

发表于 2012-5-31 17:39 | 显示全部楼层

Private Sub UserForm_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
If KeyCode = 27 Then
   Unload Me
End If
If KeyCode = 90 And Shift = 2 Then
Me.Height = Me.Height + 10
End If
If KeyCode = 88 And Shift = 2 Then
Me.Height = Me.Height - 10
End If
End Sub

Private Sub UserForm_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
If Shift = 3 Then
Unload Me
End If
End Sub

窗体作业.xls

35 KB, 下载次数: 1

点评

最后一题不对  发表于 2012-6-5 08:39
回复

使用道具 举报

发表于 2012-5-31 17:41 | 显示全部楼层
a组学委:qushui
  1. Private Sub UserForm_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
  2. If KeyCode = 27 Then Unload Me
  3. If KeyCode = 90 And Shift = 2 Then Me.Height = Me.Height + 10
  4. If KeyCode = 88 And Shift = 2 Then Me.Height = Me.Height - 10
  5. End Sub

  6. Private Sub UserForm_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
  7. If Button = 1 And Shift = 3 Then Unload Me
  8. End Sub
复制代码

评分

参与人数 1金币 +10 收起 理由
兰色幻想 + 10 答案正确

查看全部评分

回复

使用道具 举报

发表于 2012-5-31 17:43 | 显示全部楼层
Private Sub UserForm_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
If KeyCode = 27 Then
   Unload Me
End If
If KeyCode = 90 And Shift = 2 Then
Me.Height = Me.Height + 10
End If
If KeyCode = 88 And Shift = 2 Then
Me.Height = Me.Height - 10
End If
End Sub

Private Sub UserForm_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single)
If Button = 1 And Shift = 3 Then
Unload Me
End If
End Sub

评分

参与人数 1金币 +10 收起 理由
兰色幻想 + 10 答案正确

查看全部评分

回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|Archiver|Excel精英培训 ( 豫ICP备11015029号 )

GMT+8, 2024-4-28 08:01 , Processed in 0.443483 second(s), 20 queries , Gzip On, Yac On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

快速回复 返回顶部 返回列表