Forum Discussion
Bao_bab
Feb 17, 2023Copper Contributor
Copy a formula result to a cell in another sheet + add succesive formula results in consecutive rows
Hi, I am running a partially randomize set of data and trying to find the best solutions depending on certain parameter changes. I need to "record" certain solutions and then compare different re...
HansVogelaar
Feb 17, 2023MVP
Try this:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim ws As Worksheet
Set ws = Worksheets("Sheet5")
If Not Intersect(Range("M252:S252"), Target) Is Nothing Then
ws.Range("A" & ws.Rows.Count).End(xlUp).Offset(1).Value = Range("S255").Value
End If
End Sub- Bao_babFeb 20, 2023Copper Contributor
ThankHansVogelaar
For some reason, it is not working though. I keep getting the "Compile error: Method or data member not found" message.
- HansVogelaarFeb 20, 2023MVP
The code works as intended when I test it.
Could you attach a small sample workbook demonstrating the problem (without sensitive data), or if that is not possible, make it available through OneDrive, Google Drive, Dropbox or similar? Alternatively, you can attach it to a private message to me. Thanks in advance.
- Bao_babFeb 24, 2023Copper Contributor
Thanks @Hans Vogelaar ! Went for the second option.