part of my macro has a simple equation n /6, when n is < 6, the result is rounded down to 0.
is there any way I can have this result always roundup?
is there any way I can have this result always roundup?
VBA Code:
.Rows(lrNewRows) = Array(Cells(lr, "A"), ".", n \ 6, "F51114", "No", " ", " ", " ", "Purchased", " ", "Primer")
VBA Code:
Sub WrapidSealNine()
Dim lrNewRows As Long, n As Long, I As Long, lrNew As Long
lrNewRows = ActiveSheet.Range("A" & Rows.Count).End(xlUp).Row
lrNew = ActiveSheet.Range("A" & Rows.Count).End(xlUp).Row
sr = 2
For I = 2 To lastRow
If Range("K" & I).Value Like "*9*" And _
Range("K" & I).Value Like "*Wrapid-Seal*" Then
n = WorksheetFunction.SumIfs(Range("C" & sr & ":C" & lr), Range("K" & sr & ":K" & lr), "*9"" Wrapid-Seal*")
End If
Next I
With Columns("A:K")
lrNewRows = lrNewRows + 1
.Rows(lrNewRows) = Array(Cells(lr, "A"), ".", n, "F51041", "No", " ", " ", " ", "Purchased", " ", "9"" Closure")
If Cells(lrNewRows, "C").Value = 0 Or _
Cells(lrNewRows, "C").Value < 0 Then
Rows(lrNewRows).Delete
End If
lrNewRows = lrNewRows + 1
.Rows(lrNewRows) = Array(Cells(lr, "A"), ".", n \ 6, "F51114", "No", " ", " ", " ", "Purchased", " ", "Primer")
If Cells(lrNewRows, "C").Value = 0 Or _
Cells(lrNewRows, "C").Value < 0 Then
Rows(lrNewRows).Delete
End If
lrNew = lrNewRows + 1
.Rows(lrNew) = Array(Cells(lr, "A"), ".", " ", "F51040", "No", " ", " ", " ", "Purchased", " ", "Wrapid-Seal")
If Cells(lrNewRows, "C").Value = 0 Or _
Cells(lrNewRows, "C").Value < 0 Then
Rows(lrNew).Delete
End If
End With
End Sub