(Solved) – Limit Sum of Values and Subtraction

(solved)-–-limit-sum-of-values-and-subtraction

I wanted to implement a code that would reference values from another worksheet in the current document, sum those values and limit the addition to a value of 90 to then substract them to a set of values stored in another column. I keep getting an error for property assigned

Private Sub Worksheet_Change(ByVal Target As Range)
Dim a As Long
Dim b As Long
Dim Filament As Integer
Dim Remaining As Integer
Dim sumRemaning As Integer
a = 1
b = 1
'Add loop here for Filament
For b = 1 To 10
Filament = Cells(Target.Row("A"))
sumRemaining = 0
    Do While sumRemaining <= 90
        a = a   1
        Remaining = Worksheets("Printer Log").Cells(a, 2)
        sumRemaining = sumRemaining   Application.WorksheetFunction.sum(Remaining)
    Loop
Cells(b, 3).Value = Filament - sumRemaining
Next b
End Sub

Leave a Reply

Your email address will not be published. Required fields are marked *