0

vba で vlookup 式を使用するときに切り上げられた結果が得られないようにする方法はありますか。これが私のコードです:

Sub test()
Dim lastrow, pressurecolumn, lastcolumn As String, total As Integer, x, row, irow, column As Double
lastrow = Range("B8").End(xlDown).Value + 7

Range("Pump_design[Total Pipe losses from plantroom]").ClearContents
For Each row In Columns("EZ")
For irow = 8 To lastrow
total = 0
For column = 4 To 153
x = Cells(irow, column).Value
If Not IsEmpty(x) Then
total = total + Application.WorksheetFunction.VLookup(x, Sheets("Pump Design").Range("Pump_design"), 154, False)
End If
Next column
Cells(irow, "EZ") = Round(total, 4)
If Cells(irow, "EZ") = 0 Then Cells(irow, "EZ").ClearContents
Next irow
row = irow + 1
Next row
End Sub
4

1 に答える 1

0

整数ではなく倍精度で合計を取得するトリックを見つけました

于 2016-05-23T03:51:31.973 に答える