pasting changing data to a new worksheet
I am new to VBA so any help would be appreciated.
I have three sets of data into my spreadsheet via a dde link cells B1
C1 & D1
The data is used to perform a calculation and the result is displayed
in cell A2
At the moment my code pastes the data range A2 - D2 to F2 -I2 whenever
the data changes.
What i would really like to do is to paste this information to a second
sheet add a date and time stamp and use a new row for each new set of
data.
The code i am using is below
Private Sub Worksheet_Calculate()
Worksheet_Change Range("$A$2")
End Sub
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$2" Then
Application.ScreenUpdating = False
With Sheets("sheet1")
.Range("A2:D2").Copy
.Range("F2").PasteSpecial Paste:=xlPasteValues, Operation:=xlNone,
SkipBlanks _
:=False, Transpose:=False
End With
Application.ScreenUpdating = False
End If
End Sub
regards
Jonathan
|