Hello,
I wrote this bit of code, but it takes a while to calculate considering how many times I use it - I believe it takes really long because it runs the code through the entire table column.
I am looking to try and get this to work faster, maybe by calculating only when there is a change or perhaps another way I am unaware of.
Please have a look at let me know how I may go about to doing this.
the code gives me the desired output.. It just takes its sweet time in doing so.
Posting image for visual idea of what the code should do
I wrote this bit of code, but it takes a while to calculate considering how many times I use it - I believe it takes really long because it runs the code through the entire table column.
I am looking to try and get this to work faster, maybe by calculating only when there is a change or perhaps another way I am unaware of.
Please have a look at let me know how I may go about to doing this.
the code gives me the desired output.. It just takes its sweet time in doing so.
VBA Code:
Sub checkProgress()
Application.ScreenUpdating = False
Dim i As Long
For i = 2 To Rows.Count
If Range("C" & i).Value = "" Or Range("I" & i).Value <> "" Or Range("A" & i).Value <> "" Then
Else
Range("I" & i).Value = Application.WorksheetFunction.SumIfs(Range("G2:G" & i), Range("C2:C" & i), Range("C" & i), Range("D2:D" & i), Range("D" & i))
Range("H" & i).Value = Range("E" & i).Value - Range("I" & i).Value
End If
Next i
Application.ScreenUpdating = True
End Sub
Posting image for visual idea of what the code should do