|
楼主 |
发表于 2010-9-15 09:09
|
显示全部楼层
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
原帖由 aa574629576 于 2010-9-14 15:45 发表
Private Sub MultiPage1_Enter()
Dim s1%, s2%, s3%, s4%, s5%, s6%, s7%, s8%, s9%, s10%, i%, rng As Range
MultiPage1.Value = 0
With Worksheets("离职人员")
.Visible = -1
. ...
错误的原因不明,应该跟此处的运算无关,关于Select Case可以简化一下:
- For Each rng In Range(Cells(2, 3), Cells(s1 + 1, 3))
- Select Case rng.Value
- Case "设备能源管理部", "设备能源部", "变电所"
- s5 = s5 + 1
- Case "工程管理部", "工程项目管理部", "工程管理组"
- s6 = s6 + 1
- Case "公司管理部"
- s7 = s7 + 1
- Case "车队", "后勤工段", "党政办公室", "人事办公室"
- s7 = s7 + 1
- Case "供销部", "采购组", "储运工段"
- s8 = s8 + 1
- Case "生产安全环保部", "化验中心", "安全保卫科", "生产调度室", "生产技术科", "保卫科"
- s9 = s9 + 1
- Case "采矿厂", "安全生产室", "地测室"
- s10 = s10 + 1
- Case "七角井选矿厂", "长流水磨选工段", "厂部", "磨选工段", "破碎工段"
- s11 = s11 + 1
- Case "钒冶炼厂"
- s12 = s12 + 1
- Case "公司领导"
- s13 = s13 + 1
- Case "财务资产室"
- s14 = s14 + 1
- End Select
- Next
复制代码 |
|