Once only calculation - help please
That's the bad news. Excel doesn't keep track of the cell that changed with
worksheet_calculate.
And I don't know anything about DDE to know if there's a way around this.
Maybe someone who knows DDE stuff can post a better solution--or at least
commiserate with you.
rhay999 wrote:
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
Dave Peterson Wrote:
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
--
rhay999
--
Dave Peterson
|