ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Need a macro to delete selected rows (https://www.excelbanter.com/excel-programming/287424-need-macro-delete-selected-rows.html)

RKettle

Need a macro to delete selected rows
 
I need help to design an excel 97 macro that will delete
the currently selected row and a hidden one immediately
under it in their entirety.

Any help is appreciated

Don Guillett[_4_]

Need a macro to delete selected rows
 
try this
ActiveCell.Resize(2, 1).EntireRow.Delete

--
Don Guillett
SalesAid Software

"RKettle" wrote in message
...
I need help to design an excel 97 macro that will delete
the currently selected row and a hidden one immediately
under it in their entirety.

Any help is appreciated




Rob van Gelder[_4_]

Need a macro to delete selected rows
 
Sub testit()
Dim rng As Range

With ActiveCell.EntireRow
Set rng = Range(.Cells, .Offset(1, 0))
End With
rng.Delete xlUp
End Sub

Rob

"RKettle" wrote in message
...
I need help to design an excel 97 macro that will delete
the currently selected row and a hidden one immediately
under it in their entirety.

Any help is appreciated




Rob van Gelder[_4_]

Need a macro to delete selected rows
 
Ignore my code, use Don's. Resize is certainly the way to go.


"Rob van Gelder" wrote in message
...
Sub testit()
Dim rng As Range

With ActiveCell.EntireRow
Set rng = Range(.Cells, .Offset(1, 0))
End With
rng.Delete xlUp
End Sub

Rob

"RKettle" wrote in message
...
I need help to design an excel 97 macro that will delete
the currently selected row and a hidden one immediately
under it in their entirety.

Any help is appreciated






RKettle

Need a macro to delete selected rows
 
Thanks all, I'll give it a try on Monday when I get back to the office.

Rob

RKettle

Need a macro to delete selected rows
 
The resize code works great.

Thanks all

Rob



All times are GMT +1. The time now is 01:25 AM.

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