You probably need:
application.worksheetfunction.roundup(h_range * 0.13,0)
where 0 is the number of decimal places to round to.
I think it probably hangs because I didn't reset the count to 0 when it loops to the next row, so the loop until count = 1000 to make it stop if it goes to high doesn't work, try:
Option Explicit
Sub asd()
Dim l_range, h_range, eyer, eyee, count, count_1, salary As Double
For count_1 = 9 To 25
count = 0
l_range = 1480.01
h_range = 1500
With Sheets("may")
salary = .Range("H" & count_1).Value
Do
If l_range <= salary And salary <= h_range Then
eyer = WorksheetFunction.RoundUp(h_range * 0.13, 0)
eyee = WorksheetFunction.RoundUp(h_range * 0.11, 0)
.Range("L" & count_1).Value = eyer
.Range("M" & count_1).Value = eyee
Exit Do
Else
l_range = l_range + 20
h_range = h_range + 20
count = count + 1
End If
Loop Until count = 1000
End With
Next
End Sub
Bookmarks