View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
J_Knowles J_Knowles is offline
external usenet poster
 
Posts: 28
Default Delete Table row with first cell not empty

Sub ClearContentsTableBlanks()
' checks A-E rows 6 thru 100 for blanks, and clear contents of row
For i = 6 To 100
For j = 1 To 5
If IsEmpty(Cells(i, j).Value) Then
Range(Cells(i, 1), Cells(i, 5)).ClearContents
Exit For
End If
Next j
Next i
Range("A1:E100").Select
End Sub

HTH,
--
Data Hog


"GBExcel via OfficeKB.com" wrote:

Hi,

I need a macro to do the following:

I have a table like this, starting in row 6.


] ] A B C D E
6] 1 N N N
7] 2 N N N N
8] 3 N N N N
9] 4
10]5
11]
12]
13]
etc.
100]

Rows 11 to 100 are empty.

I want to select area A1:E100 and delete all content from table rows A9:E9
and A10:E10, because these table rows have empty cells from columns B through
to E. The rows are marked by an ID number as in numbers 1 to 5 above. When
cells in columns B to E are found to be empty, the content of the table row,
including the row ID, must be deleted. Note, this is not deleting the entire
excel row, just the content of rows 9 and 10 or down.

Appreciate the help.

GBExcel

--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...mming/201001/1

.