Forum Discussion
rwagner34
Mar 15, 2021Copper Contributor
Update data when new data is entered in a rage of cells
Is there a way to update data on a different sheet (like a dashboard) only when new data is entered in a different sheet - and only display the new data. For example in sheet 2 I have a row of names...
rwagner34
Mar 26, 2021Copper Contributor
mtarler Is there a way for this to work if I am linking the changed cell to another worksheet? It does not seem to update the dashboard when the data changes in the cell that is pointing to another excel file.
In the cell that is changing:
='[rotation schedule.xlsx]Monday 1A'!$G$2
I have the code below on the worksheet, if I manually change the field it appears on the Dashboard, but it does not when I link it like above and the data changes. The field that is changing is in D2
Private Sub Worksheet_Change(ByVal Target As Range)
Dim dashUpdate As Range
Set dashUpdate = ThisWorkbook.Sheets("Dashboard").Range("$A$6")
If Intersect(Target, Range("$A$2:$D$47")) Is Nothing Then
Else
Target.EntireRow.Copy dashUpdate
End If
End Sub
mtarler
Mar 26, 2021Silver Contributor
That is correct since the contents of the cell haven't changed only the value being displayed is changing. There is a legacy functionality that has to do with track changes that might be useful for this but I'm not going to go there. Instead, you would need to create a mirrored sheet and track those cells of interest on every _CALCULATE and if a change is detected you can copy the row and update the value onto the mirrored/storage sheet. That said, what will you do if more than 1 value changes? Technically this could be a concern on the _change function also.