Sub abc() Dim i Dim coloumn coloumn = 2 For i = 1 To 8 Dim currentValue currentValue = Val(ReplaceChar(Sheet2.Cells(i, coloumn))) If Application.WorksheetFunction.IsNumber(currentValue) Then If Abs(currentValue) < 0.05 Then Sheet2.Cells(i, coloumn).Interior.ColorIndex = 6 End If End If Next i End Sub Private Function ReplaceChar(c As String) As String Dim a a = Replace(c, "*", "") ‘If InStr(a, "-") = 1 Then ‘ a = Replace(a, "-", "-0") ‘End If ReplaceChar = a End Function
时间: 2024-11-03 20:55:29