Auto add"" a Row !

avinashraste

Board Regular
Joined
Mar 12, 2008
Messages
167
Friends,

I have an excel sheet with certain data. I have 30 rows with some columns. What I want to do is -

1. I want to add the fresh data row at the end of the day.

2. As I do not want to increase the number of the row, I want to add the new row & simultaneously want to delete the first row automatically when I update the last row with the new data

Is this possible ? If yes then please guide with the steps & code...!

Thanks in Advance

AR
 
This is one way. Put this in the sheet's code module.

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
    With Me
        Do Until .UsedRange.Rows.Count <= 30
            .Rows(1).Delete shift:=xlUp
        Loop
    End With
End Sub
 
Upvote 0

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top