View Single Post
  #6   Report Post  
rhay999 rhay999 is offline
Junior Member
 
Posts: 5
Default

Dave -

Thanks very much for the code - very concise and works beautifully.

One small problem - after couple of hundred rows being entrered, Excel starts to slow down as each event is re-calculating the code for all the previous ones - or that is the way is seems. Unfortuantely, there could be low thousands of rows being loaded.

Is there any way that the code could be triggered just on the current row/current cell changing rather than a global change to the worksheet?

Thanks again.

Richard

Quote:
Originally Posted by Dave Peterson
I don't know anything about DDE--but maybe you can tie into a calculation event:

Option Explicit
Private Sub Worksheet_Calculate()

Dim myRng As Range
Dim myCell As Range

With Me
Set myRng = .Range("A1", .Cells(.Rows.Count, "A").End(xlUp))
End With

On Error Resume Next
Application.EnableEvents = False
For Each myCell In myRng.Cells
If IsEmpty(myCell.Offset(0, 1)) = False Then
'do nothing--it's already filled
Else
myCell.Offset(0, 1).Value = myCell.Value
End If
Next myCell
Application.EnableEvents = True
On Error GoTo 0

End Sub

Good luck,

Dave Peterson