Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
delete the test values, but do not delete the formulas | Excel Discussion (Misc queries) | |||
How to Delete a Range in Closed Workbook (to Replace Delete Query) | Excel Discussion (Misc queries) | |||
How do i delete a macro in Excel 2003 when delete isn't highlight | Excel Discussion (Misc queries) | |||
How to delete rows when List toolbar's "delete" isnt highlighted? | Excel Worksheet Functions |