View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Don Guillett Don Guillett is offline
external usenet poster
 
Posts: 10,124
Default Insert row after last (filled row)

try this
Sub copyline()
With Range("a22").End(xlDown)
.Copy .Offset(1)
End With
End Sub

for the whole row
Sub copyline()
With Range("a22").End(xlDown)
.entirerow.Copy .Offset(1)
End With
End Sub

--
Don Guillett
SalesAid Software

wrote in message
ps.com...
Hello guys,

I'm having problems at programming a piece to add a printer to a
list...
The first printers (31 of them) are allready filled. They are given an
ID represented by
a simple number (eg. 1st printer row has number 1, 2nd printer row has
number 2, etc...).
The indexing begins at A5 with the number 1, each printer has now 6
topics (columns): "ID, number, IP, Description, Location, Date of first
use". Now ive added a button "Add new printer" and i want to have a sub
in a module that finds the last number (in this case 31, because the
cell below it, is empty) and insert a new row in it.
Now the sub will have to loop until he finds an empty cel in the A
column starting from A5. The row must be inserted below the last filled
row and must copy the cell formatting of the row above.

Any help very much appreciated...any questions gladly answered.


greetings from Belgium

Stanny

PS: After this works i'll come with another question... :)