|
Sub 题目1()
On Error Resume Next
Dim rg As Range
For Each rg In Selection
If rg.Value > 0 Then
rg = "正数"
End If
Next rg
End Sub
Sub 题目2()
On Error Resume Next
Dim x As Integer, y As Integer, i As Integer, rg As Range
For x = 2 To 12
For y = 1 To 3
If IsNumeric(Cells(x, y)) And Cells(x, y) > 0 Then
i = i + 1
If i = 1 Then Set rg = Cells(x, y)
Set rg = Union(rg, Cells(x, y))
End If
Next y
Next x
rg.EntireRow.Select
End Sub
|
|