2016-05-23 10 views
0

vlookup式をvbaで使用すると切り上げられないようにする方法があります。ここに私のコードは次のとおりです。vlookup関数がvbaで切り上げられる

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 

答えて

0

ちょうどトリックではなく、整数

のdoubleとして総取得見つかりました
関連する問題