Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
How to del last two rows
Hi Guys.
It dosn't matter how many row in the worksheet. how to create a formula or macro to del only the last two rows. |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
How to del last two rows
the last 2 rows that I want to del is not the last two rows of the worksheet.
the last 2 rows I want to del is in my report, sometime the last two rows at row 258 and 259. or 158,159, or 236,237. "jlclyde" wrote: On Nov 20, 12:39 pm, Johnny wrote: Hi Guys. It dosn't matter how many row in the worksheet. how to create a formula or macro to del only the last two rows. All worksheets have the same number of rows. If you want to delete rows 65536 and 65535 that is a simple macro. Sub Deletelast2rows() Range("A65535", "IV65536").Delete End Sub If you want the last two rows that have something in them then that is a little trickier. You will use End(xl(up) Jay |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
How to del last two rows
Can you pick out a column that would be used to determine that last used row?
Dim LastRow as long with worksheets("sheet9999") lastrow = .cells(.rows.count,"A").end(xlup).row if lastrow 1 then .rows(lastrow-1).resize(2).delete end if end with I used column A to determine that last used row. Johnny wrote: the last 2 rows that I want to del is not the last two rows of the worksheet. the last 2 rows I want to del is in my report, sometime the last two rows at row 258 and 259. or 158,159, or 236,237. "jlclyde" wrote: On Nov 20, 12:39 pm, Johnny wrote: Hi Guys. It dosn't matter how many row in the worksheet. how to create a formula or macro to del only the last two rows. All worksheets have the same number of rows. If you want to delete rows 65536 and 65535 that is a simple macro. Sub Deletelast2rows() Range("A65535", "IV65536").Delete End Sub If you want the last two rows that have something in them then that is a little trickier. You will use End(xl(up) Jay -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Copy rows of data (eliminating blank rows) from fixed layout | Excel Discussion (Misc queries) | |||
Excel 2003 -Rows hidden. Scrolling unhides rows ! How do I stop th | Excel Discussion (Misc queries) | |||
Copying multiple rows to other worksheets (but amount of rows varies) - How? | Excel Discussion (Misc queries) | |||
Pivot Tables: How do I show ALL field rows, including empty rows?? | Excel Worksheet Functions | |||
flexible paste rows function that inserts the right number of rows | Excel Discussion (Misc queries) |