Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Macro to delete rows
-----Original Message----- I was hoping to create a VBA function that would identify empty or blank cells within a range, and then delete the row associated with that empty or blank cell. Can anyone provide some help? Thanks! . here a macro: Sub Macro1() Dim x As Integer Dim y As Integer Dim x1 As Integer x = "Row Start" For x1 = "Row Start" To "Row end" If Len(Cells(x, 5)) = 0 Then '"Column for blank" exmple a = 1, c = 3 Rows(x).Select Rows(x).Delete x = x - 1 'You just delete a line, so need to back up End If x = x + 1 Next x1 End Sub |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
macro to delete rows | Excel Discussion (Misc queries) | |||
Macro to delete rows | Excel Discussion (Misc queries) | |||
Need a macro to delete rows | Excel Discussion (Misc queries) | |||
Macro to delete rows | Excel Programming | |||
macro to delete entire rows when column A is blank ...a quick macro | Excel Programming |