|
Sub 替换()
With Worksheets("11集题目")
Dim rg As Range, dyg As Range
Set rg = Selection
For Each dyg In Selection
If Application.WorksheetFunction.IsNumber(dyg) = True And dyg.Value > 0 Then
'If dyg.Value > 0 Then
dyg.Value = "正数"
End If
Next dyg
End With
End Sub
Sub 选择行()
Dim myrange As Range, dyg As Range, zsh As Range, zsh1 As Integer, x As Range, zshx As Integer
Set myrange = Range("a2:c12")
For Each dyg In myrange
If Application.WorksheetFunction.IsNumber(dyg) = True And dyg.Value > 0 Then zsh1 = dyg.Row
Set x = Rows(zsh1)
Exit For
Next dyg
For Each dyg In myrange
If Application.WorksheetFunction.IsNumber(dyg) = True And dyg.Value > 0 Then zshx = dyg.Row
Set zsh = Union(x, Rows(zshx))
Next dyg
zsh.Select
End Sub
|
|