View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Jacob Skaria Jacob Skaria is offline
external usenet poster
 
Posts: 8,520
Default Automatically Increment numerically ordered rows

Suppose lngRow is the row number where a row is to inserted

lngRow = 5
Rows(lngRow).Insert
Rows(lngRow).Range("A1") = Rows(lngrow - 1).Range("A1") + 1

If this post helps click Yes
---------------
Jacob Skaria


"Robin" wrote:

I have code that automatically copies a row and then inserts new rows in a
worksheet that are copies of that row, based on a number entered by a user
through an InputBox. The first cell in the row contains a number that needs
to increment as the new rows are inserted. In other words, in the row that
is copied there is a cell with a value of '1' and I need that value to be
incremented for each new row that is inserted. So, if Excel inserts ten
additional rows, that number should be incremented from '1' in the copied row
all the way to '11' in the newly inserted rows.