View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Oliver Ferns via OfficeKB.com Oliver Ferns via OfficeKB.com is offline
external usenet poster
 
Posts: 15
Default Looping Macro for fixed number of rows

Hi,

Try this...it is untested but it should work. If not it will point you in
the right direction...

Option Explicit

Sub LoopEm()
Dim rngLoop as Range, rngLastRec as Range, rngFirstRec as Range, lngInc as
Long

Set rngLoop = thisworkbook.sheets(1).range("R2:AU4993")

For lngInc = rngloop.rows.count to 2 step - 26
Set rngLastRec = rngloop.rows(lngInc)
Set rngFirstRec = rngloop.rows(lngInc - 25)
Let rngFirstRec.value = rngLastRec.value
Next lngInc

Set rngFirstRec = Nothing
Set rngLastRec = Nothing

End Sub

Hth,
Oli

--
Message posted via http://www.officekb.com