Excel macro to lookup cell and add new row

Closed
john2191 Posts 1 Registration date Saturday March 20, 2010 Status Member Last seen March 20, 2010 - Mar 20, 2010 at 10:12 PM
aquarelle Posts 7140 Registration date Saturday April 7, 2007 Status Moderator Last seen March 25, 2024 - Mar 21, 2010 at 03:13 PM
Hi,

I want to create a macro which will look at for example column A and find the last number entered then add a row below it and to do this every time its ran.

Thank you,
Related:

1 response

aquarelle Posts 7140 Registration date Saturday April 7, 2007 Status Moderator Last seen March 25, 2024 491
Mar 21, 2010 at 03:13 PM
Hello,

Try with this macro :

Sub Insert_Row() 
Dim n As Integer 
n = Cells(Rows.Count, 1).End(xlUp).Row  
    Rows(n).Select 
    Selection.Insert Shift:=xlUp 
End Sub


Best regards
"Pour trouver une solution à ses problèmes, il faut s'en donner la peine."
0