-
Speed up loop?
My code is running slower than I would like, thinking maybe my loop needs some tweeking to speed things up. The variable LastRow and DataStart give me the row location fof the start and end data.
[VBA]
Dim LastRow As Long
Dim DataStart As Long
Dim x As Long
For x = DataStart To LastRow
Range("E" & x).FormulaR1C1 = "=ABS(RC[-2])"
Range("F" & x).FormulaR1C1 = "=ABS(RC[-2])"
Range("G" & x).FormulaR1C1 = "=RC[-2]/(R4C15*R6C15)"
Range("H" & x).FormulaR1C1 = "=RC[-2]/(R8C15)"
Range("I" & x).FormulaR1C1 = "=RC[-1]-(R30C14)"
Range("J" & x).FormulaR1C1 = "=RC[-1]*100"
Next x
[/VBA]
-
Don't loop!
[vba]
Range("E" & DataStart).Resize(LastRow + 1 - DataStart).FormulaR1C1 = "=ABS(RC[-2])"
[/vba]
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
-
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules