View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
GS[_6_] GS[_6_] is offline
external usenet poster
 
Posts: 1,182
Default Performance lag issue

Try this way to see if it's any faster...


Option Explicit

Sub Test()
Dim rng As Range
Set rng = Range("L2:L10000").Resize(, 21)
Application.Index(rng, 0, 2) = "=IF(RC[-3]="""","""",(RC[-3]-INT(RC[-3])))"
Application.Index(rng, 0, 3) =
"=IF(RC[-4]="""","""",IF(OR(RC5=RC33,RC5=RC34,1),2))"
Application.Index(rng, 0, 4) = "=IF(AND(RC14=2,RC13<0.25),RC13+0.5,RC13)"
Application.Index(rng, 0, 5) = "=RC15"
Application.Index(rng, 0, 6) = "=IF(RC11="""","""",RC11-INT(RC11))"
Application.Index(rng, 0, 7) =
"=IF(RC15="""","""",IF(RC17RC15,RC17-RC15,RC15-RC17))"
Application.Index(rng, 0, 8) =
"=IF(RC16="""","""",IF(RC17RC16,""LATE"",IF(RC17< RC16,""EARLY"",""ON
TIME"")))"
Application.Index(rng, 0, 9) =
"=IF(RC[-14]="""","""",IF(AND(RC19=""LATE"",(RC17-RC16<0.0208)),""ON
TIME"",IF(RC17<RC16,""EARLY"",IF(RC17=RC16,""ON TIME"",""LATE""))))"
Application.Index(rng, 0, 10) =
"=IF(RC12="""","""",TIME(HOUR(RC12),MINUTE(RC12),S ECOND(RC12)))"
Application.Index(rng, 0, 11) = "=IF(RC9="""","""",RC9-1)"
Application.Index(rng, 0, 12) =
"=IF(COUNTIFS(RC11:RC11,RC8:RC8,RC17:RC17,RC17)=1, 1,"""")"
Application.Index(rng, 0, 13) =
"=SUMIFS(C[-15]:C[-15],C[-16]:C[-16],RC[-16],C[-13]:C[-13],RC[-13])"
Application.Index(rng, 0, 14) = "=IF(RC[-2]="""","""",((RC[-2]*RC[-3])-1))"
Application.Index(rng, 0, 15) = "=IF(RC[-3]<1,0,IF(RC[-1]24,23,RC[-1]))"
Application.Index(rng, 0, 16) = "=IF(RC[-1]0,15,0)"
Application.Index(rng, 0, 17) =
"=IF(ISERROR(RC[-4]*2+RC[-1]),0,(RC[-4]*2+RC[-1]))"
Application.Index(rng, 0, 18) = "=IF(RC[-1]=0,0,(RC[-1]/1440))"
Application.Index(rng, 0, 19) =
"=IF(RC[-7]<1,0,IF(RC[-14]RC[-9],0,IF(RC[-13]<RC[-14],RC[-9]-RC[-14],RC[-9]-RC[-13])))"
Application.Index(rng, 0, 20) =
"=IF(RC[-8]<1,0,IF(RC[-1]RC[-2],0,IF(RC[-1]-RC[-2],0)))"
Application.Index(rng, 0, 21) = "=IF(RC12="""","""",TRIM(RC5))"
With Range("M2:M10000").Resize(, 20): .Value = .Value: End With
End Sub

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion