Private Sub (A)
Dim Arr As the Variant
Dim As Long I
Arr=Sheets (1). The Rows (1)
For I=1 To 5000
Sheets (2). Rows (I)=Arr
DoEvents
Next I
End Sub
Private Sub (B)
Dim As Long I
For I=1 To 5000
Sheets (1). Rows (I) Copy Destination:=Sheets (2). The Rows (I)
DoEvents
Next I
End Sub
I found that, after each For method A memory are constant, and B will always increase,
Why is this?
CodePudding user response:
When the second method should be replicated in memory retains a large amount of data...CodePudding user response:
Help you to test the discovery after (repeat RUN many times)Methods A memory=17 MB
Methods the memory B=17 MB
And didn't find strange