Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Is there a way to prevent pasting data into an Excel worksheet? Rod from Corrections Excel Worksheet Functions 16 November 20th 06 01:01 PM
Automatically pasting worksheet data to new worksheet with formulas COntactJason Excel Worksheet Functions 0 August 10th 05 08:22 PM
Pasting data without the worksheet automatically delimiting it? NiallC Excel Discussion (Misc queries) 3 August 8th 05 09:23 AM
Copy data from 3rd worksheets and pasting to active worksheet KimberlyC Excel Programming 4 June 29th 05 02:09 AM
Pasting Data into a worksheet Andy W Excel Programming 0 February 23rd 04 01:20 PM


All times are GMT +1. The time now is 11:51 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"