Thanks! I used the loop. I tried using your formula but it didn't really work for me.
Here's what I used.
Sub EPF_Calculator()
With ThisWorkbook.Sheets("may")
Dim l_range, h_range, eyer, eyee, count, salary As Double
l_range = 1480.01
h_range = 1500
salary = (.Cells(9, 8).Value + .Cells(9, 9).Value)
Do
If l_range <= salary And salary <= h_range Then
eyer = RoundUp(h_range * 0.13)
eyee = RoundUp(h_range * 0.11)
.Cells(9, 12).Value = eyer
.Cells(9, 13).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
How can I implement this macro for a specified range of cells? Do I use the .range function?
Bookmarks