LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 49
Default Another Delete question

Jeremiah,

Looping is the way to go. BUT you work from the bottom of the list up.

For instance you have a nice list with a number of columns, starting in A1.

Sub DeleteRows()
Dim rng As Range
Dim lRows As Long
Dim lCounter As Long

Set rng = Range("A1").CurrentRegion
lRows = rng.Rows.Count

'Loop through list from the bottom.
For lCounter = lRows To 1 Step -1
If Cells(lCounter, 4).Value = "" Then
Cells(lCounter, 4).EntireRow.Delete
End If
Next
End Sub

Make sure your list has NO entirely blank rows within it to begin with.


Paul



"jeremiah" wrote in message
...
I need to group records by the value in column A (employees, who can have
multiple records) and then delete all of any employees who have no records
with a date in column D.

Have given this some thought and have tried filters, loops, offsets and
just
can't quite figure out the best way to do it. The groups of records will
be
variable each week.



 
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
Range - Delete question kirkm[_6_] Excel Programming 4 April 29th 07 03:32 PM
delete macro question Gary Keramidas Excel Programming 2 December 21st 05 06:57 AM
A Marco Delete Question [email protected] Excel Programming 1 July 16th 04 08:59 PM
help: automated delete without question John Wilson Excel Programming 0 August 12th 03 09:40 PM


All times are GMT +1. The time now is 10:26 PM.

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

About Us

"It's about Microsoft Excel"