luizmachado
New Member
- Joined
- Dec 15, 2015
- Messages
- 11
I have this code where I want get the entire value from a division, for example 7/2 gives me 3.5, not 3 (as the quotient function would give me). It works separately (on the fx line), but I need this to refresh automatically every time some data changes.
It won't go further because of this comma "," between the cells. I don't know what to do to fix it. Do you guys have any idea of what I can do?
Sub Division()
Dim LastRow As Long
LastRow = Cells(Cells.Rows.Count, "I").End(xlUp).Row
Range("I" & LastRow).Formula = "=sum((quotient(E" & LastRow - 1 & ", F" & LastRow - 1 & "), (mod(E" & LastRow - 1 & ",F" & LastRow - 1 & ")/F" & LastRow - 1 & "))"
End Sub
It won't go further because of this comma "," between the cells. I don't know what to do to fix it. Do you guys have any idea of what I can do?
Sub Division()
Dim LastRow As Long
LastRow = Cells(Cells.Rows.Count, "I").End(xlUp).Row
Range("I" & LastRow).Formula = "=sum((quotient(E" & LastRow - 1 & ", F" & LastRow - 1 & "), (mod(E" & LastRow - 1 & ",F" & LastRow - 1 & ")/F" & LastRow - 1 & "))"
End Sub