View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Binzelli[_10_] Binzelli[_10_] is offline
external usenet poster
 
Posts: 14
Default Delete line if value in column C = ""

Hi !

The following code should do the trick:


Sub DeleteEmptyC()

Dim Row As Long
Dim EndRow As Long

Row = 2
EndRow = 500


Do While Row <= EndRow

If IsEmpty(Cells(Row, 3)) Then
Rows(Row).Select
Selection.Delete Shift:=xlUp
'Subtract 1 from Row and EndRow for every row deleted
Row = Row - 1
EndRow = EndRow - 1
End If

Row = Row + 1
Loop

End Sub


Good luck

"TheLeafs " wrote in message
...
Good day,

I have three columns of data in A, B & C. Data exists in column A & B,
but in some cells in column C there is no data. I want to delete the
entire row if no data is found in column C. I have very limited
experience in writing macro's. I am wondering if someone can draw up
how I can get this started. The range of the data is from A2:C500.

Thanks for any help.


---
Message posted from http://www.ExcelForum.com/