View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default insert a row for every 20,000 th row?


Public Sub ProcessData()
Const TEST_COLUMN As String = "A" '<=== change to suit
Const INSERT_ROW As Long = 5 '<=== CHANGE TO SUIT
Dim i As Long
Dim iLastRow As Long

With ActiveSheet

iLastRow = .Cells(.Rows.Count, TEST_COLUMN).End(xlUp).Row
iLastRow = iLastRow + INSERT_ROW - iLastRow Mod INSERT_ROW
For i = iLastRow To 1 Step -INSERT_ROW
Rows(i).Insert
Next i

End With

End Sub



--
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)

"elaine" wrote in message
oups.com...
Hi all,

Jsut wondering whether theres a worksheet function or code that could
automatically insert a row for every 20,000 row? or just every X
row??

Thanks for your help :D

Elaine.