View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Klaus[_4_] Klaus[_4_] is offline
external usenet poster
 
Posts: 6
Default how to run through a table an delete the empty cells?

Try the following macro:

Sub DelteValues()
x = 25 'for example
For i = 1 To x
If Cells(i, 1).Value = "" Then
Cells(i, 2).Value = ""
' or to delete the entire row:
' Rows(i).EntireRow.Delete
End If
Next
End Sub

Regards
Klaus

-----Original Message-----
I need to write a macro to run through a list of values

in column A and
B.

If column A is blank, then I have to delete cells A and B
correspondingly.

Is it very difficult to do that?


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

.