|
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
Sub 按钮1_Click()
Arr = [c3].CurrentRegion
For j = 4 To Cells(Rows.Count, "j").End(3).Row
If Len(Cells(j, "j")) > 0 Then
For k = 2 To UBound(Arr, 2)
If Arr(1, k) = Cells(j, "i") Then
C = k
Exit For
End If
Next k
For I = 2 To UBound(Arr)
If Val(Arr(I, 1)) = Val(Cells(j, "j")) Then
Cells(j, "k") = Arr(I, C)
Exit For
Else
If Val(Arr(I, 1)) > Val(Cells(j, "j")) Then
Cells(j, "k") = Arr(I - 1, C) + (Arr(I, C) - Arr(I - 1, C)) * (Cells(j, "j") - Arr(I - 1, 1)) / 10
Exit For
End If
End If
Next I
End If
Next j
End Sub
Sub 按钮2_Click()
Arr = [c3].CurrentRegion
For j = 4 To Cells(Rows.Count, "O").End(3).Row
If Len(Cells(j, "O")) > 0 Then
For k = 2 To UBound(Arr, 2)
If Arr(1, k) = Cells(j, "N") Then
C = k
Exit For
End If
Next k
For I = 2 To UBound(Arr)
If Val(Arr(I, C)) = Val(Cells(j, "O")) Then
Cells(j, "P") = Arr(I, 1)
Exit For
Else
If Val(Arr(I, C)) > Val(Cells(j, "O")) Then
Cells(j, "P") = (Cells(j, "O") - Arr(I - 1, C)) / (Arr(I, C) - Arr(I - 1, C)) * 10 + Arr(I - 1, 1)
Exit For
End If
End If
Next I
End If
Next j
End Sub
|
评分
-
1
查看全部评分
-
|