lushang2018老师的程序不知道为什么报错,istr的子过程未定义
Function 是否包含数字(oRng As Range) As Boolean
Dim bHaveNumbers As Boolean, i As Long
bHaveNumbers = False
For i = 1 To Len(oRng.Text)
If IsNumeric(Mid(oRng.Text, i, 1)) Then
bHaveNumbers = True
Exit For
End If
Next
是否包含数字 = bHaveNumbers
End Function
Sub TestSub()
Dim i, j, k, arr, brr, x, y, rng As Range
Sheet1.Activate
For i = 1 To Cells(Rows.Count, "A").End(xlUp).Row
For j = 1 To Cells(1, Columns.Count).End(xlToLeft).Column
If Cells(i, j) <> "×" And istr(Cells(i, j), ".") <> 0 And 是否包含数字(Cells(i, j)) = False Then
If Cells(i, j).Offset(0, -1) <> "" Then
Cells(i, j) = Cells(i, j).Offset(0, -1) & Cells(i, j)
Cells(i, j).Offset(0, -1).Clear
ElseIf ceils(i, j).Offset(0, -2) <> "" Then
Cells(i, j) = Cells(i, j).Offset(0, -2) & Cells(i, j)
End If
If Cells(i, j).Offset(0, 1) <> "" Then
Cells(i, i) = Cells(i, j).Offset(0, 1) & Cells(i, j)
Cells(i, j).Offset(0, 1).Clear
ElseIf Cells(i, j).Offset(0, 2) <> "" Then
Cells(i, j) = Cells(i, j).Offset(o, 2) & Cells(i, j)
End If
Else
Cells(i, j).Clear
End If
Next
Next
End Sub
谢谢老师
|