I have a spreadsheet where sheet("summary").Cells("K4") = sheet("component").Cells("G7").
This is written as a formula, e.g. =SUM('Component'!G7).
I am trying to achieve the same through VBA. I can get the summary cell to copy the others. but it just copies it the once when it is created. How can I make this re-calculate everytime it is changed?
Sub PopulateTestsExecuted()
' Populates the Summary sheet with the tests executed per component
Dim i As Integer, component As String, goHere As Range, fromHere As Range
With frmGetSetUpData.lstComponents
Set goHere = Sheets("Summary").Range("K4")
For i = 0 To .ListCount - 1
component = .List(i)
Set fromHere = Sheets(component).Range("G7")
goHere = fromHere
Set goHere = goHere.Offset(i, 0)
Next i
End With
End Sub
Bookmarks