View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
simon simon is offline
external usenet poster
 
Posts: 21
Default Adding rows to create list from DDE data

I have data updated via a DDE link and each time the DDE link updates I need to capture the data so that it creates a list by adding a new row. I have used the SheetCalculateEvent to trigger the update to cell B2 (which links to another cell which is the DDE link) which then invokes the SheetChangeEvent.

My problem is that on each update a new row is inserted at the top of the list for the new data and this causes the screen to flicker as all the data is moved. I would rather have the data just build progressively so that the new data is added to the bottom of the list. Can someone help how best to achieve this? My code is

Private Sub Worksheet_Calculate(

Worksheet_Change Range("$B$2"

End Su

Private Sub Worksheet_Change(ByVal Target As Range
If Target.address = "$B$2" The
Sheets("intraday").Selec
Range("A2:E2").Selec
Selection.Cop
Range("A4").Selec
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks
:=False, Transpose:=Fals
If Range("B4") Range("B5") The
Range("I10").Selec
Selection.EntireRow.Inser
Range("A4:H4").Selec
Selection.Cop
Range("I10").Selec
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks
:=False, Transpose:=Fals
Range("A4:E4").Selec
Selection.Cop
Range("A5").Selec
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks
:=False, Transpose:=Fals
End I
End I

End Su

I should explain that I copy the range A2..E2 (which contains the target cell) to A4..E4, and this is then compared to the same data prior to the last update which is contained at A5..E5 to do some extra calcs in F5..H5. If the new update at B4 is than the last update at B5, then the new update is added to the list at I10..P10

Any help gratefully received

Thanks, Simon