Excel精英培训网

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

交作业

[复制链接]
发表于 2013-6-27 22:03 | 显示全部楼层 |阅读模式
兰校长 交作业!
题目一:
Sub t()
Dim x As Range
For Each x In Selection
If x > 0 Then      'if x.value>0 这个是标准写法
x = "正数"
End If
Next x
End Sub
题目二:
Sub hh()
Dim x As Integer
    Dim y As Integer
    Dim rg As Range
     Set rg = Cells(2, 1)
    For x = 2 To 12
        For y = 1 To 3
            If Cells(x, y) > 0 And Application.WorksheetFunction.IsNumber(Cells(x, y)) Then
                Set rg = Union(rg, Cells(x, y))
            End If
            Next y
        Next x
    rg.EntireRow.Select

End Sub

发表于 2013-6-27 22:14 | 显示全部楼层
回复

使用道具 举报

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

本版积分规则

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

GMT+8, 2024-5-22 18:13 , Processed in 0.177559 second(s), 7 queries , Gzip On, Yac On.

Powered by Discuz! X3.4

Copyright © 2001-2020, Tencent Cloud.

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