ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   how do i record changing cell data (cell is dde linked) (https://www.excelbanter.com/excel-discussion-misc-queries/46523-how-do-i-record-changing-cell-data-cell-dde-linked.html)

Morph

how do i record changing cell data (cell is dde linked)
 
I have a cell that is constantly changing value, and need to record these
changes so I can plot them on a chart.

Dave Peterson

How are they changing?

Is a user changing them by typing them in?

You can do it using an event macro.

Rightclick on the worksheet tab that should have this behavior. Select view
code. Paste this into the code window.

Then back to excel to test it out:

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)

Dim DestCell As Range

With Target
If .Cells.Count 1 Then Exit Sub
If Intersect(.Cells, Me.Range("a1")) Is Nothing Then Exit Sub
If IsEmpty(.Value) Then Exit Sub
If IsError(.Value) Then Exit Sub

With Worksheets("sheet2")
Set DestCell = .Cells(.Rows.Count, "A").End(xlUp).Offset(1, 0)
End With

DestCell.Value = .Value

End With

End Sub

I logged the value into sheet2 column A.

Morph wrote:

I have a cell that is constantly changing value, and need to record these
changes so I can plot them on a chart.


--

Dave Peterson


All times are GMT +1. The time now is 08:35 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com