ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   removing old data (https://www.excelbanter.com/excel-programming/330354-removing-old-data.html)

Robert Hargreaves

removing old data
 
Hi

I am trying to remove 10 rows from a sheet starting with row A4 down on
every sheet to allow for headers.

Replace them with dates in blank rows at the bottom of the sheet and follow
patterns down of formulas, conditional formatting and dates as if you select
the copy drag down to continue a pattern down the sheet with a mouse.

eg. (remove 3 and add three to column A)
Row 1
Row 2
Row 3
01/01/05
02/01/05
03/01/05
04/01/05
05/01/05
06/01/05

would change to when the code is run to column A lookig like this -
Row 1
Row 2
Row 3
04/01/05
05/01/05
06/01/05
07/01/05
08/01/05
09/01/05

This would be a start but I dont know how to do this or the conditional
formatting either can anyone help?

Thanks

Rob




Mike Fogleman

removing old data
 
Robert: this should do it.

Sub UpDate()
ActiveSheet.Rows("4:6").Delete
Range("A5:A6").AutoFill Destination:=Range("A5:A9")
End Sub

Mike F
"Robert Hargreaves" wrote in message
...
Hi

I am trying to remove 10 rows from a sheet starting with row A4 down on
every sheet to allow for headers.

Replace them with dates in blank rows at the bottom of the sheet and
follow patterns down of formulas, conditional formatting and dates as if
you select the copy drag down to continue a pattern down the sheet with a
mouse.

eg. (remove 3 and add three to column A)
Row 1
Row 2
Row 3
01/01/05
02/01/05
03/01/05
04/01/05
05/01/05
06/01/05

would change to when the code is run to column A lookig like this -
Row 1
Row 2
Row 3
04/01/05
05/01/05
06/01/05
07/01/05
08/01/05
09/01/05

This would be a start but I dont know how to do this or the conditional
formatting either can anyone help?

Thanks

Rob






All times are GMT +1. The time now is 10:58 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com