• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

How to make paste special faster when we have records more than 60,000

ThrottleWorks

Excel Ninja
Hi,

I have a formula in cell A2.
I am pasting this formula in cell A2:A65000.

When I do it manually, excel takes 2-3 minutes to get refreshed and reflect values correctly.
When I do it with VBA, macro does not calculates entire column before triggering next line of code.

I have written activesheet.calculate 3-4 times in the code but still it does not help.
How do I overcome this problem.
I also tried to write a loop for this, but loop is taking too much time to complete.
Or is there any where I can store all the values from FOR EACH LOOP in an array and pass it with a single line once loop is complete

Can anyone please help me in this.

Code:
For Each TRng In TempRng
        MySht.Cells(TRng.Row, 1).FormulaR1C1 = "=IF(AND(COUNTIFS(C[1],RC[1],C[9],""Y*""
>0,COUNTIFS(C[1],RC[1],C[9],""N*"")>0),""Yoyo"",""NoNo"")"
        MySht.Cells(TRng.Row, 1).Value = MySht.Cells(TRng.Row, 1).Value
    Next TRng
 
Last edited:
I'd say have the macro put in the formula and calculate first and then do the below for value paste

Code:
Sub RNGVAL()

Application.Calculation = xlCalculationAutomatic

Dim Rng As Range
Dim LstRow As String

LstRow = Cells(Rows.Count, "A").End(xlUp).Row
Set Rng = Range("A2:A" & LstRow)

Rng = Rng.Value

End Sub
 
Back
Top