Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default 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



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default 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



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default 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





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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


  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default Need a macro to delete selected rows

The resize code works great.

Thanks all

Rob

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to delete rows if... Sasikiran Excel Discussion (Misc queries) 6 June 29th 09 07:16 AM
delete rows-macro TUNGANA KURMA RAJU Excel Discussion (Misc queries) 5 January 13th 06 12:01 PM
Creating a macro commad to shift selected rows to the right next c Shifting of Multiple Row to the right Excel Discussion (Misc queries) 1 September 15th 05 03:31 AM
delete columns and rows-cells equalling zero or any selected value Scottie Excel Worksheet Functions 2 May 9th 05 08:47 PM
Delete/Collapse Rows Not Selected Cindy Excel Programming 19 November 21st 03 03:38 AM


All times are GMT +1. The time now is 08:23 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"