LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default delete row?

See I misinterpreted your situation - disregard.

--
Regards,
Tom Ogilvy

"Tom Ogilvy" wrote in message
...
Assume your data is contiguous with headers in row 1 and each "customer
record" consisting of 3 rows with no dividers/blank lines separating a
customer and the check is made in column A. If any cell in a 3 row group
in column A is blank, the 3 row group is deleted. In the example, your 3
row groups start in A2 and end in A31.

Sub Tester1()
Dim rng As Range, rng1 As Range
Dim cell As Range, rng2 As Range
Set rng = Range("A2:A31")
For Each cell In rng
If (cell.Row - 2) Mod 3 = 0 Then
Set rng1 = cell.Resize(3, 1)
If Application.CountA(rng1) < 3 Then
If rng2 Is Nothing Then
Set rng2 = rng1
Else
Set rng2 = Union(rng2, rng1)
End If
End If
End If
Next
If Not rng2 Is Nothing Then
rng2.EntireRow.Delete
End If


End Sub

That is about the best guess I can make on the limited information you

give.
It is hard to test an unspecified cell.

--
Regards,
Tom Ogilvy



"Vince" wrote in message
...
need some help on this one.

Is there a way to check to see if there is a value or not null for three
cells in a row and if there is not, then delete the row?

Example:

I have sheets of customer information where each row is a different

customer
(name, address, ect..), but if they do not have a contact number (home,
work, cell) i would like to delete them.

I'm pretty sure that this can be done via macro, but don't know how. Any

and
all help is greatly appreciated!

Thanks
Vince







 
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
delete the test values, but do not delete the formulas kathy Excel Discussion (Misc queries) 1 February 21st 07 07:03 PM
How to Delete a Range in Closed Workbook (to Replace Delete Query) [email protected] Excel Discussion (Misc queries) 1 March 8th 06 10:10 AM
How do i delete a macro in Excel 2003 when delete isn't highlight Abel Excel Discussion (Misc queries) 2 September 13th 05 04:09 AM
How to delete rows when List toolbar's "delete" isnt highlighted? Linda Excel Worksheet Functions 1 May 26th 05 08:39 PM


All times are GMT +1. The time now is 03:37 AM.

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"