Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help needed to speed code up
Hi all,
I have code below that i got of this site to compare columns "L" & "H" and put the difference in "K" if no value in "L" then nothing. However the code is very slow on large spreadsheets of more than 5000 lines. Could somebody please help to improve the code to make it work faster ?? Sub InsPriceDiff() ' Dim rng As Range, cell As Range Dim mynum As Variant Dim i As Long Dim numRows As Long Dim LastRow As Long Set rng = Range(Range("H4"), Range("H4").End(xlDown)) For Each cell In rng If cell.Offset(0, 4) < cell.Value And Not IsEmpty(cell.Offset(0, 4)) Then mynum = cell.Offset(0, 0) - cell.Offset(0, 4) cell.Offset(0, 3) = mynum End If Next End Sub Les Stout *** Sent via Developersdex http://www.developersdex.com *** |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Need to Speed Up A Code | Excel Worksheet Functions | |||
Speed up Code? | Excel Programming | |||
Speed up code | Excel Programming | |||
Code Speed Up | Excel Programming |