ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   macros deleting rows (https://www.excelbanter.com/excel-discussion-misc-queries/237347-macros-deleting-rows.html)

Anthony

macros deleting rows
 
I use a macro to provide summary data relating to rows of information, the
summary is presented below the rows of information.

The information rows vary from 10 rows to over 100 from day to day.

The problem i have is how to place the summary row 3 rows beneath the last
row of data given the number of rows varies.

I know I could solve it by placing summary above but presentation asists by
being under. Any help greatly appreciated

joel

macros deleting rows
 
Post the macro

Here is an example

LastRow = Range("A" & Rows.Count).End(xlup).Row

SummaryRow = LastRow + 3


Now if you need to delete the old summary row before adding new data

LastRow = Range("A1").End(xldown).Row
NewRow = LastRow + 1
Rows(NewRow & ":" & Rows.count).Delete

xlup goes to Rows.Count which is a constant 65536 and move up the wroksheet
until data is found. sldown move down the wroksheet until a blank cell is
found in the next row.





"Anthony" wrote:

I use a macro to provide summary data relating to rows of information, the
summary is presented below the rows of information.

The information rows vary from 10 rows to over 100 from day to day.

The problem i have is how to place the summary row 3 rows beneath the last
row of data given the number of rows varies.

I know I could solve it by placing summary above but presentation asists by
being under. Any help greatly appreciated



All times are GMT +1. The time now is 10:35 AM.

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