Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Adding/removing rows in Excel
Is there an easy way of making code change automatically
to make allowance for adding or removing rows in a spreadsheet, without manually changing the code ? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Adding/removing rows in Excel
Assume column A can be used to find the number of rows
set rng = Range(cells(1,1),cells(rows.count,1).End(xlup)) for each cell in rng If you have a data table/database construct set rng = range("a1").CurrentRegion in either case Dim lastrow as Long lastrow = rng.rows(rng.row.count).row for i = lastrow to 1 step -1 if cells(lastrow,1).Value = 0 then cells(lastrow,1).EntireRow.Delete end if Next as an example. -- Regards, Tom Ogilvy "Don" wrote in message ... Is there an easy way of making code change automatically to make allowance for adding or removing rows in a spreadsheet, without manually changing the code ? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Adding or removing rows | Excel Discussion (Misc queries) | |||
Adding/Removing Rows Automatically. | Excel Discussion (Misc queries) | |||
Removing Blank Rows in an excel spreadsheet | Excel Discussion (Misc queries) | |||
Automatically adjusting # of entries by adding/removing rows | Excel Worksheet Functions | |||
Removing excess rows in excel | Excel Worksheet Functions |