Пожалуйста, нажмите на ссылку, чтобы увидеть мое изображение
Вот мой код Я не понимаю, почему всегда ложно только десятичное число. Что я должен делать?
Sub calcu()
Dim a As Integer
Dim b As Integer
Dim c As Integer
Dim d As Integer
Dim g1 As Double
Dim g2 As Double
Dim hdp As Double
Dim ts1 As Double
Dim ts2 As Double
Application.ScreenUpdating = False
a = Cells(Rows.Count, "C").End(xlUp).Row
For b = 1 To a
If IsNumeric(Cells(b, "C").Value) Then
hdp = Cells(b, "G")
ts1 = Cells(b, "L")
ts2 = Cells(b, "M")
t1 = Cells(b, "F")
t2 = Cells(b, "H")
g1 = ts1 - hdp
g2 = ts2 - hdp
v1 = 1.72
v2 = 2.1
v3 = 1.9
v4 = 1.8
v5 = 2
If InStr(t1, "K") And g1 < ts2 Then
Cells(b, "J") = "0"
ElseIf InStr(t1, "K") And g1 = ts2 Then
Cells(b, "E") = 1
Cells(b, "J") = 1
ElseIf InStr(t2, "K") And g2 < ts1 Then
Cells(b, "E") = "0"
ElseIf InStr(t2, "K") And g2 = ts1 Then
Cells(b, "E") = 1
Cells(b, "J") = 1
Else
Cells(b, "E") = "error"
Cells(b, "J") = "error"
End If
End If
Next
Application.ScreenUpdating = True
End Sub