Excel精英培训网

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

11集配套练习答案

[复制链接]
发表于 2013-9-13 20:31 | 显示全部楼层 |阅读模式
sub 第一题()
On Error Resume Next
Dim rg As Range
For Each rg In Range(Selection.Address)
If IsNumeric(rg) And rg.Value > 0 And rg.Value <> "" Then
rg = "正数"
End If
Next
end sub
sub 第二题()
Sub o()
Dim rg As Range
Dim rg1 As Range
Dim x As Integer
Dim y As Integer
Dim i As Integer
i = 0
For x = 2 To 12
  For y = 1 To 3
   Set rg = Cells(x, y)
   If IsNumeric(rg) And rg.Value > 0 And rg.Value <> "" And i = 0 Then
  Set rg1 = Cells(x, y)
  i = i + 1
  GoTo 100
  End If
  If IsNumeric(rg) And rg.Value > 0 And rg.Value <> "" Then
      Set rg1 = Union(rg1, rg)
     End If
   Next y
100:
   Next x
rg1.EntireRow.Select
end sub

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

本版积分规则

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

GMT+8, 2024-5-22 17:24 , Processed in 0.162157 second(s), 8 queries , Gzip On, Yac On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

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