Short story: I need to update a budget template to automatically multiply a cell value by that of another. There are two ranges involved, E62:P75 and E84:P86. Right now I'm just trying to get it working with the first range. In the corresponding D for a cell is the per month rate. For each month E:P, you should be enter in an integer and the script then replaces that value with the value times per month rate. If the field is blank or not an integer, then it defaults to 0.
I keep getting "Run-time error: '-2147417848 (80010108)': Method 'Value' of object 'Range' failed".
Here's my code:
Private Sub Worksheet_Change(ByVal Target As Range) Dim i As Integer Dim j As Integer Dim k As Integer If Not Intersect(Target, Range("E62:P75")) Is Nothing Then For i = 62 To 75 For j = 5 To 16 If IsNumeric(Cells(i, j).Value) Then If Cells(i, j).Value < 100 Then ' k = Cells(i, j).Value * Cells(i, 4).Value ' Cells(i, j).Value = k Cells(i, j).Value = Cells(i, j).Value * Cells(i, 4).Value End If Else Cells(i, j).Value = 0 End If Next j Next i End If End Sub
I've also attached the spreadsheet. Any suggestions?