Not sure why, but am getting an error I don’t understand and so haven’t managed to debug.
the error is: RUN TIME ERROR '1004'
The subsequent code from this is below (relevant in yellow) – I think as the previous sub-routine doesn’t complete, we lose the index for this one – if I’ve not misunderstood is there a quick error handler we could squeeze in here for that?
CODE:
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
On Error GoTo 0
If Target.Column = 2 And Target.Row = 1 Then 'Target cell with Loan ID
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
ReDim Preserve CurrentID(Sheets.Count)
CurrentID(Target.Worksheet.Index) = Target 'Refers to global DATAID
'----------DUMP-------------
Dump PreviousID(Target.Worksheet.Index), _
Target.Worksheet.Name 'Dump previous data
'---------POPUP-------------
Pop CurrentID(Target.Worksheet.Index), _
Target.Worksheet.Name 'Populate current ID data
'---------------------------
ReDim Preserve PreviousID(Sheets.Count)
PreviousID(Target.Worksheet.Index) = _
CurrentID(Target.Worksheet.Index) 'Refers to global DATAID
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
End If
End Sub
Bookmarks