Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
This one worked perfectly. Genius. Thanks guys.
"Mike" wrote: This might work for you Sub deleterows() Dim rng As Range Dim i As Long Set rng = ActiveSheet.Range(Cells(1, "A"), _ Cells(Rows.Count, "A").End(xlUp)) With rng For i = .Rows.Count To .Rows.Count - 4 Step -1 .Cells(i).EntireRow.Delete Next i End With End Sub "clayton ledford" wrote: Hello, I have created a macro to re-format a report i receive in excel. I'm having a problem adding the following instruction. I need to use the macro to find and select the last five rows, then delete those rows. This is a problem because the report length varies each day when i receive the report. Even if there is one to find and select just the last row. I can repeat 5 times. Clay |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
find & delete rows based on text | Excel Discussion (Misc queries) | |||
find text and delete rows. | Excel Discussion (Misc queries) | |||
Find and delete all other rows | Excel Discussion (Misc queries) | |||
Find & delete rows with ID's from another sheet. | Excel Discussion (Misc queries) | |||
Macro to find and delete rows! | Excel Discussion (Misc queries) |